1111from test_framework .authproxy import JSONRPCException
1212
1313from base_test import PIVX_FakeStakeTest
14- from util import mints_to_stakingPrevOuts
1514
1615class Test_03 (PIVX_FakeStakeTest ):
1716
1817 def run_test (self ):
1918 self .description = "Covers the scenario of a zPoS block where the coinstake input is a zerocoin spend of an already spent coin."
2019 self .init_test ()
2120
22- DENOM_TO_USE = 5000 # zc denomination
23- INITAL_MINED_BLOCKS = 321
24- MORE_MINED_BLOCKS = 301
25- self .NUM_BLOCKS = 2
21+ DENOM_TO_USE = 5000 # zc denomination
22+ INITAL_MINED_BLOCKS = 321 # First mined blocks (rewards collected to mint)
23+ MORE_MINED_BLOCKS = 301 # More blocks mined before spending zerocoins
24+ self .NUM_BLOCKS = 2 # Number of spammed blocks
2625
2726 # 1) Starting mining blocks
2827 self .log .info ("Mining %d blocks to get to zPOS activation...." % INITAL_MINED_BLOCKS )
@@ -58,7 +57,7 @@ def run_test(self):
5857 sleep (2 )
5958 mints = self .node .listmintedzerocoins (True , True )
6059 sleep (1 )
61- stakingPrevOuts = mints_to_stakingPrevOuts (mints )
60+ stakingPrevOuts = self . get_prevouts (mints , zpos = True )
6261 mints_hashes = [x ["serial hash" ] for x in mints ]
6362
6463 # This mints are not ready spendable, only few of them.
@@ -96,4 +95,10 @@ def run_test(self):
9695
9796 # 7) Create "Fake Stake" blocks and send them
9897 self .log .info ("Creating Fake stake zPoS blocks..." )
99- self .test_spam ("Main" , stakingPrevOuts , spendingPrevOuts = spendingPrevOuts , fZPoS = True )
98+ err_msgs = self .test_spam ("Main" , stakingPrevOuts , spendingPrevOuts = spendingPrevOuts , fZPoS = True )
99+
100+ if not len (err_msgs ) == 0 :
101+ self .log .error ("result: " + " | " .join (err_msgs ))
102+ raise AssertionError ("TEST FAILED" )
103+
104+ self .log .info ("%s PASSED" % self .__class__ .__name__ )
0 commit comments