-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathminting_testcases.py
executable file
·2348 lines (2320 loc) · 88 KB
/
minting_testcases.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import copy
from random import randint, choice
from test_framework.mininode import COIN
BAD_REWARD_COMMON = 'non-mandatory-script-verify-flag (Bad reward'
BAD_REWARD_ROBBERY = 'non-mandatory-script-verify-flag (Bad reward. Everybody be cool, this is a robbery!!!)'
BAD_REWARD_NOT_MATURE = 'non-mandatory-script-verify-flag (Bad reward, not matured)'
BAD_REWARD_BEN_AMOUNT_TOO_HIGH = 'non-mandatory-script-verify-flag (Bad reward, BIG BEN)'
BAD_REWARD_LIMIT_EXCEEDED = 'non-mandatory-script-verify-flag (Bad reward, limit exceeded)'
BAD_REWARD_CERT_EXPIRED = 'non-mandatory-script-verify-flag (Bad reward, cert expired)'
BAD_REWARD_MANY_MONEYBOX_INPUTS = 'non-mandatory-script-verify-flag (Bad reward, too many moneybox inputs)'
BAD_REWARD_MANY_MONEYBOX_OUTPUTS = 'non-mandatory-script-verify-flag (Bad reward, too many moneybox outputs)'
BAD_REWARD_MANY_USER_OUTPUTS = 'non-mandatory-script-verify-flag (Bad reward, too many user outputs)'
BAD_REWARD_MANY_BEN_OUTPUTS = 'non-mandatory-script-verify-flag (Bad reward, too many beneficiary outputs)'
BAD_REWARD_SCRIPT = 'non-mandatory-script-verify-flag (Bad reward, script)'
BAD_REWARD_ZERO_REPCENT = 'non-mandatory-script-verify-flag (Bad reward, zero percent)'
'''
Parameters description:
'name': 'any_name', # name of testcase, string. May be used to run testcase with this name: 'minting.py --runtestcase=name'
'rootcertamount': 1 * COIN, # amount to transfer in root certificate, int in satoshi, string or Decimal in coins
'greenflag': True, # greenflag, True or False
'ca3certamount': 1000000, # amount to transfer in ca3 certificate, int in satoshi, string or Decimal in coins, 1000000 means 10 percent
'ben_enabled': False, # beneficiary pubkey enabled, True or False
'ca3_age': 22 * 60 * 60, # age of ca3 certificate, in seconds
'usermoney_age': 24 * 60 * 60, # age of user money, in seconds
'useramount': 100 * COIN, # amount of user money, int in satoshi, string or Decimal in coins
'reward_to': 'ben+other' # destination where reward outputs will be sent to in mint transaction, string, see @destination_type@ below
# 'user': reward amount will be added to user amount, without creating separate output
'rewardamount': COIN // 365, # reward amount, int in satoshi, string or Decimal in coins
'fee_total': 'auto', # total fee in minting transaction, int in satoshi, string or Decimal in coins, or may be 'auto'
'fee_user_percent': 0, # what percent of fee_total user will pay, must be int 0 <= x <= 100, or may be 'auto'
'refill_moneybox': 'node', # who will refill moneybox, may be one of: 'node', 'script', 'random'
'keys_count_total': randint(1,15), # total keys count in user multisig P2SH address in M of N scheme (keys_count_total == N), int, 1 <= x <= 15
'keys_count_required': 'random', # required keys count in user multisig P2SH address in M of N scheme (keys_count_required == M), int,
# in regular workflow is (1 <= x <= keys_count_total), also may be None, 0 or 'random'
# None or 0 means that this field is not set in certificate, this means (keys_count_required == keys_count_total) by default
# 'random' means random value in range (1 <= x <= keys_count_total)
'keys_count_used': 'auto', # used keys count in user multisig P2SH address in M of N scheme, in regular workflow is (keys_count_used == keys_count_required), int, may be 'auto'
# 'auto' means (keys_count_used == keys_count_required)
'accepted': True, # whether minting transaction is valid and will be accepted by the node, True or False
Optional parameters (may absent):
'revoke_root_cert': True, # Root certificate is revoked, True or False, default False
'revoke_user_cert': False, # User certificate is revoked, True or False, default False
'invalid_root_cert_ref': 1 # Invalid reference to root certificate in mint transaction, int, possible values:
# 1: non-existing transaction (certificate)
# 2: regular P2PKH transaction, not certificate
# 3: invalid certificate: transfers money to another P2PKH address, not to itself
# 4: another root certificate, not a parent of user certificate (CA3 keys in root and user certificates are different)
# 5: invalid root certificate, with unknown root key not mentioned in genezis block
# 6: root certificate with root key mentioned in genezis block, but not in the first entry (in the second entry)
'invalid_user_cert_ref': 1 # Invalid reference to user certificate in mint transaction, int, possible values:
# 1: non-existing transaction (certificate)
# 2: regular P2PKH transaction, not certificate
# 3: invalid certificate: transfers money to another P2PKH address, not to itself
# 4: another user certificate, not a parent of used user keys (user keys used in minting transaction and given in this certificate are different)
# 5: invalid user coins (not mentioned in CA3 certificate), but valid user keys for signing moneybox outputs in minting tx. In other words, user tries to mint coins from another address using correct certificate.
'invalid_refill_moneybox': 1 # Refill moneybox in invalid way, int, possible values:
# 1: Don't refill moneybox
# 2: Refill moneybox on 1 satoshi less than required
# 3: Refill moneybox on 1 satoshi more than required
# 4: Refill moneybox with too low granularity: number of outputs is more than (sum/gran + 1)
# 5: Refill moneybox with too high granularity (more than 10 PLC)
'refill_moneybox_dest': 'user' # Destination where moneybox outputs will be sent when refilling moneybox, string, see @destination_type@ below
'refill_moneybox_accepted': False # Result of acceptance of a new block when refilling moneybox, True or False, default True
'green_flag_in_user_cert': True # Set up green flag in user certificate (in default workflow it is always False), True or False
'extra_moneybox_inputs_count': 2 # Number of extra moneybox inputs count (besides those that are needed to cover required amount), in regular workflow must be 0, int
'more_useramount1': 5 * COIN # One more user input, see 'useramount'
'more_useramount2': 200000 # One more user input, see 'useramount'
'moneybox_change_dest': 'user+ben' # Destination where moneybox change outputs will be sent to in mint transaction, string, see @destination_type@ below
'user_outputs_dest': 'ben' # Destination where user outputs will be sent to in mint transaction, string, see @destination_type@ below
'ca3_expiration_offset': 3600 # Expiration date offset in ca3 certificate due to block timestamp this certificate is mined in, int, in seconds
# If None, no expiration date field presents in certificate. Default None.
# 'ca3_expiration_offset' < 0: expiration date is X seconds less than the block timestamp (expires before the block this certificate is mined in)
# 'ca3_expiration_offset' == 0: expiration date is equal to the block timestamp
# 'ca3_expiration_offset' > 0: expiration date is X seconds more than the block timestamp
'ca3_minting_limit': 10 * COIN # Minting limit in ca3 certificate, int in satoshi, string or Decimal in coins, None means that it is not set, default None.
'step2_enabled': # Step 2 is enabled (compose and send one more minting transaction), True/False, default False
'step2_wait_interval': # Step 2: wait interval, in seconds
'step2_rewardamount': COIN // 365, # Step 2: reward amount, int in satoshi, string or Decimal in coins
'step2_reward_to': 'user' # Step 2: destination where reward outputs will be sent to in mint transaction, string, see @destination_type@ below
'step2_accepted': True # Step 2: whether minting transaction is valid and will be accepted by the node, True or False
'step3_enabled': # Step 3 is enabled (compose and send one more minting transaction), True/False, default False
'step3_wait_interval': # Step 3: wait interval, in seconds
'step3_rewardamount': COIN // 365, # Step 3: reward amount, int in satoshi, string or Decimal in coins
'step3_reward_to': 'user' # Step 3: destination where reward outputs will be sent to in mint transaction, string, see @destination_type@ below
'step3_accepted': True # Step 3: whether minting transaction is valid and will be accepted by the node, True or False
'error': (64, 'error-message'), # Error code and error message, any value from this pair may be None. Actual only when 'accepted' == False, otherwise is ignored.
# Ensures that received error code is equal to this one (if not None),
# and received error message starts with the given string (if not None).
'@destination_type@': 'user+ben' # Destination where outputs will be sent, string, may be expression with '+' and given values:
# 'user': to user multisig P2SH address (regular user address)
# 'user_shuffled': to user multisig P2SH address, but user keys are in wrong order (must be 'keys_count' > 1)
# 'user_pure_multisig': to user pure multisig address, not P2SH
# 'ben': to ben P2PKH address ('ben_enabled' parameter must be True)
# 'moneybox': to moneybox P2SH address
# 'other_p2pkh' or 'other': random P2PKH address
# 'other_p2sh': random P2SH address
# 'op_true': to address [OP_TRUE], anyone can spend
# 'op_false': to address [OP_FALSE], noone can spend
# Examples:
# 'moneybox+moneybox+moneybox': creates 3 moneybox outputs
# 'moneybox+user+ben': sends coins to moneybox, user and ben simultaneously, 1 output per each
# 'ben': sends coins to ben
# '': (empty string) doesn't send coins, no outputs
In any parameters instead of value there may be array of values of the same type.
This will be transformed to all possible combinations of these values.
Example:
'parameter_a' : [True, False]
'parameter_b' : [1,2,3]
Result: (True, 1), (True, 2), (True, 3), (False, 1), (False, 2), (False, 3)
'''
testcases_templates = \
[
{
# (all keys_count from 1 to 15 and all reward_to (user, ben, other) in positive scenario): accepted
'name': 'base00',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': True,
'ca3_age': 22 * 60 * 60,
'usermoney_age': 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': ['user', 'ben', 'other'],
'rewardamount': COIN * 10 // 365,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# base00, rewardamount +1 satoshi more than allowed): rejected
'name': 'base00e',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': True,
'ca3_age': 22 * 60 * 60,
'usermoney_age': 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': ['user', 'ben', 'other'],
'rewardamount': COIN * 10 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_COMMON), # BAD_REWARD_ROBBERY for user and ben, BAD_REWARD_BEN_AMOUNT_TOO_HIGH for other
},
{
# (usermoney_age < 23h, greenflag: any, ca3_age: any): rejected
'name': 'm00',
'rootcertamount': 1 * COIN,
'greenflag': [True, False],
'ca3certamount': 1000000,
'ben_enabled': True,
'ca3_age': [0, 24 * 60 * 60],
'usermoney_age': 23 * 60 * 60 - 60,
'useramount': 1000 * COIN,
'reward_to': ['user', 'ben', 'other'],
'rewardamount': COIN * 10 * 22 // 24 // 365,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_NOT_MATURE),
},
#
# greenflag == True
#
{
# (usermoney_age == 23h, greenflag == True): accepted
# + add parameter green_flag_in_user_cert=[False,True], it must be ignored, ensure that result is the same
'name': 'm01',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': 23 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': choice(['user', 'other']),
'rewardamount': COIN * 10 * 23 // 24 // 365,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'green_flag_in_user_cert': [ False, True ],
'accepted': True,
},
{
# (based on m01, greenflag=False, green_flag_in_user_cert=True, use green flag in user cert instead of root cert): rejected
'name': 'm01A',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': 23 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': choice(['user', 'other']),
'rewardamount': COIN * 10 * 23 // 24 // 365,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'green_flag_in_user_cert': True,
'accepted': False,
'error': (64, BAD_REWARD_NOT_MATURE),
},
{
# (m01, rewardamount +1 satoshi more than allowed): rejected
'name': 'm01e',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': 23 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': choice(['user', 'other']),
'rewardamount': COIN * 10 * 23 // 24 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_COMMON), # BAD_REWARD_ROBBERY for user and ben, BAD_REWARD_BEN_AMOUNT_TOO_HIGH for other
},
{
# (23h < usermoney_age < 30d, greenflag == True): accepted
'name': 'm03',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': 12 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': ['user', 'other'],
'rewardamount': COIN * 10 * 12 // 365,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m03, rewardamount +1 satoshi more than allowed: rejected
'name': 'm03e',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': 23 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': ['user', 'other'],
'rewardamount': COIN * 10 * 12 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age >= 30d, greenflag == True): accepted
'name': 'm05',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': [ 30 * 24 * 60 * 60, 31 * 24 * 60 * 60 ],
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m05, rewardamount +1 satoshi more than allowed: rejected
'name': 'm05e',
'rootcertamount': 1 * COIN,
'greenflag': True,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 0,
'usermoney_age': [ 30 * 24 * 60 * 60, 31 * 24 * 60 * 60 ],
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
#
# greenflag == False
#
{
# (usermoney_age < 20d, 20d < ca3_age < 30d, greenflag == False): rejected
'name': 'm09',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 21 * 24 * 60 * 60,
'usermoney_age': 20 * 24 * 60 * 60 - 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 19 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_NOT_MATURE),
},
{
# (ca3_age < 20d, 20d < usermoney_age < 30d, greenflag == False): accepted (ca3_age must be used)
'name': 'm10',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': True,
'ca3_age': 18 * 24 * 60 * 60,
'usermoney_age': 22 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': choice(['user', 'ben', 'other']),
'rewardamount': COIN * 10 * 18 // 365,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m10, rewardamount +1 satoshi more than allowed: rejected
'name': 'm10e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': True,
'ca3_age': 18 * 24 * 60 * 60,
'usermoney_age': 22 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': choice(['user', 'ben', 'other']),
'rewardamount': COIN * 10 * 18 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 'auto',
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_COMMON), # BAD_REWARD_ROBBERY for user and ben, BAD_REWARD_BEN_AMOUNT_TOO_HIGH for other
},
{
# (usermoney_age == 20d, ca3_age == 20d, greenflag == False): accepted
'name': 'm11',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 20 * 24 * 60 * 60,
'usermoney_age': 20 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 20 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m11, rewardamount +1 satoshi more than allowed: rejected
'name': 'm11e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 20 * 24 * 60 * 60,
'usermoney_age': 20 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 20 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age == 20d, 20d < ca3_age < 30d, greenflag == False): accepted
'name': 'm13',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 21 * 24 * 60 * 60,
'usermoney_age': 20 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 20 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m13, rewardamount +1 satoshi more than allowed: rejected
'name': 'm13e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 21 * 24 * 60 * 60,
'usermoney_age': 20 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 20 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (20d < usermoney_age < 30d, ca3_age == 20d, greenflag == False): accepted
'name': 'm15',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 20 * 24 * 60 * 60,
'usermoney_age': 23 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 20 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m15, rewardamount +1 satoshi more than allowed): rejected
'name': 'm15e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 20 * 24 * 60 * 60,
'usermoney_age': 23 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 20 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (20d < usermoney_age < 30d, 20d < ca3_age < 30d, usermoney_age > ca3_age, greenflag == False): accepted
'name': 'm17',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 23 * 24 * 60 * 60,
'usermoney_age': 25 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 23 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m17, rewardamount +1 satoshi more than allowed: rejected
'name': 'm17e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 23 * 24 * 60 * 60,
'usermoney_age': 25 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 23 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (20d < usermoney_age < 30d, 20d < ca3_age < 30d, ca3_age > usermoney_age, greenflag == False): accepted
'name': 'm19',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 29 * 24 * 60 * 60,
'usermoney_age': 25 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 25 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m19, rewardamount +1 satoshi more than allowed: rejected
'name': 'm19e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 29 * 24 * 60 * 60,
'usermoney_age': 25 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 25 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age == 30d, 20d < ca3_age < 30d, greenflag == False): accepted
'name': 'm21',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 21 * 24 * 60 * 60,
'usermoney_age': 30 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 21 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m21, rewardamount +1 satoshi more than allowed: rejected
'name': 'm21e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 21 * 24 * 60 * 60,
'usermoney_age': 30 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 21 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (20d < usermoney_age < 30d, ca3_age == 30d, greenflag == False): accepted
'name': 'm23',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 30 * 24 * 60 * 60,
'usermoney_age': 23 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 23 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m23, rewardamount +1 satoshi more than allowed: rejected
'name': 'm23e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 30 * 24 * 60 * 60,
'usermoney_age': 23 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 23 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age == 30d, ca3_age == 30d, greenflag == False): accepted
'name': 'm25',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 30 * 24 * 60 * 60,
'usermoney_age': 30 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m25, rewardamount +1 satoshi more than allowed: rejected
'name': 'm25e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 30 * 24 * 60 * 60,
'usermoney_age': 30 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age == 30d, ca3_age > 30d, greenflag == False): accepted
'name': 'm27',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 31 * 24 * 60 * 60,
'usermoney_age': 30 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m27, rewardamount +1 satoshi more than allowed: rejected
'name': 'm27e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 31 * 24 * 60 * 60,
'usermoney_age': 30 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age > 30d, ca3_age == 30d, greenflag == False): accepted
'name': 'm29',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 30 * 24 * 60 * 60,
'usermoney_age': 37 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m29, rewardamount +1 satoshi more than allowed: rejected
'name': 'm29e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 30 * 24 * 60 * 60,
'usermoney_age': 37 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age > 30d, ca3_age > 30d, usermoney_age > ca3_age, greenflag == False): accepted
'name': 'm31',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 31 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m31, rewardamount +1 satoshi more than allowed: rejected
'name': 'm31e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 31 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (usermoney_age > 30d, ca3_age > 30d, ca3_age > usermoney_age, greenflag == False): accepted
'name': 'm33',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# m33, rewardamount +1 satoshi more than allowed: rejected
'name': 'm33e',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (the same as m33, but large useramount is used): accepted
'name': 'm33A',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 5000 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 500 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# (m33A, rewardamount +1 satoshi more than allowed): rejected
'name': 'm33Ae',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 5000 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 500 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (the same as m33, but large useramount is used, close to limit 10*10 PLC): accepted
'name': 'm33B',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 10000 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 1000 * 30 // 365,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': True,
},
{
# (m33B, rewardamount +1 satoshi more than allowed): rejected
'name': 'm33Be',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 10000 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 1000 * 30 // 365 + 1,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',
'accepted': False,
'error': (64, BAD_REWARD_ROBBERY),
},
{
# (the same as m33, rewardamount is 2 times less than must be): accepted
'name': 'm33C',
'rootcertamount': 1 * COIN,
'greenflag': False,
'ca3certamount': 1000000,
'ben_enabled': False,
'ca3_age': 38 * 24 * 60 * 60,
'usermoney_age': 35 * 24 * 60 * 60,
'useramount': 100 * COIN,
'reward_to': 'user',
'rewardamount': COIN * 10 * 30 // 365 // 2,
'fee_total': 'auto',
'fee_user_percent': 0,
'refill_moneybox': 'random',
'keys_count_total': randint(1,15),
'keys_count_required': 'random',
'keys_count_used': 'auto',