Skip to content

Commit

Permalink
[Tests] Check spent nullifier in sapling_wallet_listreceived
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Dec 10, 2020
1 parent e55a089 commit e489677
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/functional/sapling_wallet_listreceived.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ def run_test(self):
# Now can check that the information is the same
assert_equal(r, r2)

# Get the note nullifier
lsu = self.nodes[1].listshieldedunspent();
assert_equal(len(lsu), 1)
nullifier = lsu[0]["nullifier"]

# Generate some change by sending part of shield_addr1 to shield_addr2
txidPrev = txid
shield_addr2 = self.nodes[1].getnewshieldedaddress()
Expand All @@ -129,6 +134,10 @@ def run_test(self):
self.sync_all()
self.generate_and_sync(height+4)

# Verify the spent nullifier
tx_json = self.nodes[1].getrawtransaction(txid, True)
assert_equal(nullifier, tx_json["vShieldedSpend"][0]["nullifier"])

# Decrypted transaction details should be correct
pt = self.nodes[1].viewshieldedtransaction(txid)
assert_equal(pt['txid'], txid)
Expand Down

0 comments on commit e489677

Please sign in to comment.