Skip to content

Commit

Permalink
[FUNCTIONAL TEST][zPIV] double spent serial validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed May 23, 2019
1 parent fdfd999 commit f46b80e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/functional/zerocoin_valid_public_spend.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,25 @@ def run_test(self):
else:
assert (rawTx["confirmations"] == 6)

self.log.info("%s PASSED" % self.__class__.__name__)
self.log.info("%s VALID PUBLIC COIN SPEND PASSED" % self.__class__.__name__)

self.log.info("%s Trying to spend the serial twice now" % self.__class__.__name__)

serial = zc[0]["s"]
randomness = zc[0]["r"]
privkey = zc[0]["k"]

tx = None
try:
tx = self.node.spendrawzerocoin(serial, randomness, DENOM_TO_USE, privkey)
except JSONRPCException as e:
self.log.info("GOOD: Transaction did not verify")

if tx is not None:
self.log.warning("Tx is: %s" % tx)
raise AssertionError("TEST FAILED")

self.log.info("%s DOUBLE SPENT SERIAL NOT VERIFIED, TEST PASSED" % self.__class__.__name__)

if __name__ == '__main__':
zPIVValidCoinSpendTest().main()

0 comments on commit f46b80e

Please sign in to comment.