Skip to content

Commit f46b80e

Browse files
committed
[FUNCTIONAL TEST][zPIV] double spent serial validation.
1 parent fdfd999 commit f46b80e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/functional/zerocoin_valid_public_spend.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,25 @@ def run_test(self):
6565
else:
6666
assert (rawTx["confirmations"] == 6)
6767

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

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

72+
serial = zc[0]["s"]
73+
randomness = zc[0]["r"]
74+
privkey = zc[0]["k"]
75+
76+
tx = None
77+
try:
78+
tx = self.node.spendrawzerocoin(serial, randomness, DENOM_TO_USE, privkey)
79+
except JSONRPCException as e:
80+
self.log.info("GOOD: Transaction did not verify")
81+
82+
if tx is not None:
83+
self.log.warning("Tx is: %s" % tx)
84+
raise AssertionError("TEST FAILED")
85+
86+
self.log.info("%s DOUBLE SPENT SERIAL NOT VERIFIED, TEST PASSED" % self.__class__.__name__)
7187

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

0 commit comments

Comments
 (0)