From f46b80ed5e86ce46e79367a755f11d143d7a1908 Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 15 May 2019 18:01:38 +0200 Subject: [PATCH] [FUNCTIONAL TEST][zPIV] double spent serial validation. --- test/functional/zerocoin_valid_public_spend.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/functional/zerocoin_valid_public_spend.py b/test/functional/zerocoin_valid_public_spend.py index 76730661feea3..70aa867d7e1d2 100755 --- a/test/functional/zerocoin_valid_public_spend.py +++ b/test/functional/zerocoin_valid_public_spend.py @@ -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()