Browse Source

Fix test broken by change indicator

metaverse
Eirik Ogilvie-Wigley 6 years ago
parent
commit
62d707d1fd
  1. 21
      qa/rpc-tests/wallet_nullifiers.py

21
qa/rpc-tests/wallet_nullifiers.py

@ -188,10 +188,23 @@ class WalletNullifiersTest (BitcoinTestFramework):
assert_equal(myzaddr in self.nodes[3].z_listaddresses(), False)
assert_equal(myzaddr in self.nodes[3].z_listaddresses(True), True)
# Node 3 should see the same received notes as node 2
assert_equal(
self.nodes[2].z_listreceivedbyaddress(myzaddr),
self.nodes[3].z_listreceivedbyaddress(myzaddr))
# Node 3 should see the same received notes as node 2; however,
# some of the notes were change for note 2 but not for note 3.
# Aside from that the recieved notes should be the same. So,
# group by txid and then check that all properties aside from
# change are equal.
node2Received = dict([r['txid'], r] for r in self.nodes[2].z_listreceivedbyaddress(myzaddr))
node3Received = dict([r['txid'], r] for r in self.nodes[3].z_listreceivedbyaddress(myzaddr))
assert_equal(len(node2Received), len(node2Received))
for txid in node2Received:
received2 = node2Received[txid]
received3 = node3Received[txid]
assert_equal(len(received2), len(received3))
for key in received2:
# check all the properties except for change
if key != 'change':
assert_equal(received2[key], received3[key])
# Node 3's balances should be unchanged without explicitly requesting
# to include watch-only balances

Loading…
Cancel
Save