@@ -30,10 +30,11 @@ use thor::{
30
30
BlockDateGenerator :: Fixed , FragmentBuilder , FragmentSender , StakePool , TransactionHash ,
31
31
} ;
32
32
33
+ const TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT : u64 = 140 ;
34
+ const TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT : u64 = 30 ;
35
+
33
36
#[ test]
34
37
pub fn explorer_stake_pool_registration_test ( ) {
35
- let query_complexity_limit = 140 ;
36
- let query_depth_limit = 30 ;
37
38
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
38
39
let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
39
40
let first_stake_pool = StakePool :: new ( & first_stake_pool_owner) ;
@@ -61,8 +62,8 @@ pub fn explorer_stake_pool_registration_test() {
61
62
) ;
62
63
63
64
let params = ExplorerParams :: new (
64
- query_complexity_limit . to_string ( ) ,
65
- query_depth_limit . to_string ( ) ,
65
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
66
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
66
67
None ,
67
68
) ;
68
69
let explorer_process = jormungandr. explorer ( params) ;
@@ -96,8 +97,6 @@ pub fn explorer_stake_pool_registration_test() {
96
97
97
98
#[ test]
98
99
pub fn explorer_owner_delegation_test ( ) {
99
- let query_complexity_limit = 140 ;
100
- let query_depth_limit = 30 ;
101
100
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
102
101
let mut stake_pool_owner = thor:: Wallet :: default ( ) ;
103
102
let stake_pool = StakePool :: new ( & stake_pool_owner) ;
@@ -133,8 +132,8 @@ pub fn explorer_owner_delegation_test() {
133
132
. expect ( "Error while sending registration certificate for stake pool owner" ) ;
134
133
135
134
let params = ExplorerParams :: new (
136
- query_complexity_limit . to_string ( ) ,
137
- query_depth_limit . to_string ( ) ,
135
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
136
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
138
137
None ,
139
138
) ;
140
139
let explorer_process = jormungandr. explorer ( params) ;
@@ -167,8 +166,6 @@ pub fn explorer_owner_delegation_test() {
167
166
168
167
#[ test]
169
168
pub fn explorer_full_delegation_test ( ) {
170
- let query_complexity_limit = 140 ;
171
- let query_depth_limit = 30 ;
172
169
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
173
170
let mut stake_pool_owner = thor:: Wallet :: default ( ) ;
174
171
let mut full_delegator = thor:: Wallet :: default ( ) ;
@@ -209,8 +206,8 @@ pub fn explorer_full_delegation_test() {
209
206
. expect ( "Error while sending registration certificate for stake pool owner" ) ;
210
207
211
208
let params = ExplorerParams :: new (
212
- query_complexity_limit . to_string ( ) ,
213
- query_depth_limit . to_string ( ) ,
209
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
210
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
214
211
None ,
215
212
) ;
216
213
let explorer_process = jormungandr. explorer ( params) ;
@@ -243,8 +240,6 @@ pub fn explorer_full_delegation_test() {
243
240
244
241
#[ test]
245
242
pub fn explorer_split_delegation_test ( ) {
246
- let query_complexity_limit = 140 ;
247
- let query_depth_limit = 30 ;
248
243
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
249
244
let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
250
245
let mut split_delegator = thor:: Wallet :: default ( ) ;
@@ -303,8 +298,8 @@ pub fn explorer_split_delegation_test() {
303
298
. expect ( "Error while sending registration certificate for stake pool owner" ) ;
304
299
305
300
let params = ExplorerParams :: new (
306
- query_complexity_limit . to_string ( ) ,
307
- query_depth_limit . to_string ( ) ,
301
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
302
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
308
303
None ,
309
304
) ;
310
305
let explorer_process = jormungandr. explorer ( params) ;
@@ -340,8 +335,6 @@ pub fn explorer_split_delegation_test() {
340
335
341
336
#[ test]
342
337
pub fn explorer_pool_update_test ( ) {
343
- let query_complexity_limit = 140 ;
344
- let query_depth_limit = 30 ;
345
338
let jcli: JCli = Default :: default ( ) ;
346
339
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
347
340
let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
@@ -372,8 +365,8 @@ pub fn explorer_pool_update_test() {
372
365
) ;
373
366
374
367
let params = ExplorerParams :: new (
375
- query_complexity_limit . to_string ( ) ,
376
- query_depth_limit . to_string ( ) ,
368
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
369
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
377
370
None ,
378
371
) ;
379
372
let explorer_process = jormungandr. explorer ( params) ;
@@ -428,8 +421,6 @@ pub fn explorer_pool_update_test() {
428
421
429
422
#[ test]
430
423
pub fn explorer_pool_retire_test ( ) {
431
- let query_complexity_limit = 140 ;
432
- let query_depth_limit = 30 ;
433
424
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
434
425
let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
435
426
let first_stake_pool = StakePool :: new ( & first_stake_pool_owner) ;
@@ -458,8 +449,8 @@ pub fn explorer_pool_retire_test() {
458
449
) ;
459
450
460
451
let params = ExplorerParams :: new (
461
- query_complexity_limit . to_string ( ) ,
462
- query_depth_limit . to_string ( ) ,
452
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
453
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
463
454
None ,
464
455
) ;
465
456
let explorer_process = jormungandr. explorer ( params) ;
@@ -507,8 +498,6 @@ pub fn explorer_pool_retire_test() {
507
498
pub fn explorer_evm_mapping_certificates_test ( ) {
508
499
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
509
500
let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
510
- let query_complexity_limit = 70 ;
511
- let query_depth_limit = 30 ;
512
501
513
502
let config = ConfigurationBuilder :: new ( )
514
503
. with_funds ( vec ! [ first_stake_pool_owner. to_initial_fund( 1_000_000 ) ] )
@@ -534,8 +523,8 @@ pub fn explorer_evm_mapping_certificates_test() {
534
523
) ;
535
524
536
525
let params = ExplorerParams :: new (
537
- query_complexity_limit . to_string ( ) ,
538
- query_depth_limit . to_string ( ) ,
526
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
527
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
539
528
None ,
540
529
) ;
541
530
let explorer_process = jormungandr. explorer ( params) ;
@@ -573,8 +562,6 @@ pub fn explorer_evm_mapping_certificates_test() {
573
562
574
563
#[ test]
575
564
pub fn explorer_vote_plan_certificates_test ( ) {
576
- let query_complexity_limit = 140 ;
577
- let query_depth_limit = 30 ;
578
565
let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
579
566
let bob = thor:: Wallet :: default ( ) ;
580
567
let discrimination = Discrimination :: Test ;
@@ -612,8 +599,8 @@ pub fn explorer_vote_plan_certificates_test() {
612
599
) ;
613
600
614
601
let params = ExplorerParams :: new (
615
- query_complexity_limit . to_string ( ) ,
616
- query_depth_limit . to_string ( ) ,
602
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
603
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
617
604
None ,
618
605
) ;
619
606
let explorer_process = jormungandr. explorer ( params) ;
@@ -643,8 +630,6 @@ pub fn explorer_vote_plan_certificates_test() {
643
630
644
631
#[ test]
645
632
pub fn explorer_vote_cast_certificates_test ( ) {
646
- let query_complexity_limit = 140 ;
647
- let query_depth_limit = 30 ;
648
633
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
649
634
let mut alice = thor:: Wallet :: default ( ) ;
650
635
@@ -699,8 +684,8 @@ pub fn explorer_vote_cast_certificates_test() {
699
684
) ;
700
685
701
686
let params = ExplorerParams :: new (
702
- query_complexity_limit . to_string ( ) ,
703
- query_depth_limit . to_string ( ) ,
687
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
688
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
704
689
None ,
705
690
) ;
706
691
let explorer_process = jormungandr. explorer ( params) ;
@@ -725,8 +710,6 @@ pub fn explorer_vote_cast_certificates_test() {
725
710
726
711
#[ test]
727
712
pub fn explorer_vote_tally_certificate_test ( ) {
728
- let query_complexity_limit = 140 ;
729
- let query_depth_limit = 30 ;
730
713
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
731
714
let mut alice = thor:: Wallet :: default ( ) ;
732
715
@@ -787,8 +770,8 @@ pub fn explorer_vote_tally_certificate_test() {
787
770
) ;
788
771
789
772
let params = ExplorerParams :: new (
790
- query_complexity_limit . to_string ( ) ,
791
- query_depth_limit . to_string ( ) ,
773
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
774
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
792
775
None ,
793
776
) ;
794
777
let explorer_process = jormungandr. explorer ( params) ;
@@ -823,8 +806,6 @@ pub fn explorer_vote_tally_certificate_test() {
823
806
#[ should_panic] //bug NPG-2742
824
807
#[ test]
825
808
pub fn explorer_update_proposal_certificate_test ( ) {
826
- let query_complexity_limit = 140 ;
827
- let query_depth_limit = 30 ;
828
809
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
829
810
let mut alice = thor:: Wallet :: default ( ) ;
830
811
let mut bob = thor:: Wallet :: default ( ) ;
@@ -882,8 +863,8 @@ pub fn explorer_update_proposal_certificate_test() {
882
863
) ;
883
864
884
865
let params = ExplorerParams :: new (
885
- query_complexity_limit . to_string ( ) ,
886
- query_depth_limit . to_string ( ) ,
866
+ TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT ,
867
+ TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT ,
887
868
None ,
888
869
) ;
889
870
let explorer_process = jormungandr. explorer ( params) ;
0 commit comments