Skip to content

Commit 26555d7

Browse files
committed
Use custom reward address in mnvaults.py.
Custom reward addresses are one of the core features needed for proper masternode vaults. With them implemented now, we can update the mnvaults.py test (resolving two FIXME's in there) to actually make use of an explicit reward address so that the masternode rewards are received and not lost (as we want them to be in practice).
1 parent 3d5352e commit 26555d7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

divi/qa/rpc-tests/mnvaults.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2020 The DIVI developers
2+
# Copyright (c) 2020-2021 The DIVI developers
33
# Distributed under the MIT/X11 software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -125,9 +125,8 @@ def fund_vault (self):
125125
self.unvaultTx = signed["hex"]
126126

127127
self.setup_masternode(2,1,"mn","copper",{"txhash":txid,"vout":vout})
128+
self.setup[1].cfg.rewardAddr = self.nodes[0].getaddress ("reward")
128129
self.cfg = self.setup[1].cfg
129-
# FIXME: Use reward address from node 0.
130-
self.cfg.rewardAddr = addr
131130
self.stop_masternode_daemons()
132131
self.start_masternode_daemons(updateMockTime=True)
133132
self.connect_masternodes_to_peers(range(3,7),updateMockTime=True)
@@ -204,6 +203,9 @@ def get_payments (self):
204203
self.advance_time (10)
205204
time.sleep(0.01)
206205

206+
# Mine some blocks normally to make sure the rewards are mature.
207+
self.mine_blocks (20)
208+
207209
# Check that some payments were made.
208210
winners = self.nodes[3].getmasternodewinners ()
209211
found = False
@@ -213,7 +215,9 @@ def get_payments (self):
213215
break
214216
assert_equal (found, True)
215217

216-
# FIXME: Check in wallet when we have a custom reward address.
218+
# The payments should have been received at the reward address
219+
# and in particular not be lost in the "destroyed" vault.
220+
assert_greater_than (self.nodes[0].getbalance ("reward"), 0)
217221

218222
def unvault (self):
219223
print ("Unvaulting the funds...")

0 commit comments

Comments
 (0)