Skip to content

Commit 3568d23

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 8ca65de commit 3568d23

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

divi/qa/rpc-tests/mnvaults.py

Lines changed: 6 additions & 5 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

@@ -78,7 +78,7 @@ def start_node (self, n):
7878
args.append ("-masternodeprivkey=%s" % self.cfg.privkey)
7979

8080
if self.cfg:
81-
cfg = [self.cfg.line]
81+
cfg = [self.cfg.getLine ()]
8282
else:
8383
cfg = []
8484

@@ -153,8 +153,7 @@ def fund_vault (self):
153153

154154
self.cfg = fund_masternode (self.nodes[0], "mn", "copper", txid,
155155
"localhost:%d" % p2p_port (1))
156-
# FIXME: Use reward address from node 0.
157-
self.cfg.rewardAddr = addr
156+
self.cfg.rewardAddr = self.nodes[0].getnewaddress ("reward")
158157

159158
for i in [0, 2]:
160159
self.stop_node (i)
@@ -242,7 +241,9 @@ def get_payments (self):
242241
break
243242
assert_equal (found, True)
244243

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

247248
def unvault (self):
248249
print ("Unvaulting the funds...")

0 commit comments

Comments
 (0)