@@ -30,10 +30,11 @@ use thor::{
3030 BlockDateGenerator :: Fixed , FragmentBuilder , FragmentSender , StakePool , TransactionHash ,
3131} ;
3232
33+ const TRANSACTION_CERTIFICATE_QUERY_COMPLEXITY_LIMIT : u64 = 140 ;
34+ const TRANSACTION_CERTIFICATE_QUERY_DEPTH_LIMIT : u64 = 30 ;
35+
3336#[ test]
3437pub fn explorer_stake_pool_registration_test ( ) {
35- let query_complexity_limit = 140 ;
36- let query_depth_limit = 30 ;
3738 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
3839 let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
3940 let first_stake_pool = StakePool :: new ( & first_stake_pool_owner) ;
@@ -61,8 +62,8 @@ pub fn explorer_stake_pool_registration_test() {
6162 ) ;
6263
6364 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 ,
6667 None ,
6768 ) ;
6869 let explorer_process = jormungandr. explorer ( params) ;
@@ -96,8 +97,6 @@ pub fn explorer_stake_pool_registration_test() {
9697
9798#[ test]
9899pub fn explorer_owner_delegation_test ( ) {
99- let query_complexity_limit = 140 ;
100- let query_depth_limit = 30 ;
101100 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
102101 let mut stake_pool_owner = thor:: Wallet :: default ( ) ;
103102 let stake_pool = StakePool :: new ( & stake_pool_owner) ;
@@ -133,8 +132,8 @@ pub fn explorer_owner_delegation_test() {
133132 . expect ( "Error while sending registration certificate for stake pool owner" ) ;
134133
135134 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 ,
138137 None ,
139138 ) ;
140139 let explorer_process = jormungandr. explorer ( params) ;
@@ -167,8 +166,6 @@ pub fn explorer_owner_delegation_test() {
167166
168167#[ test]
169168pub fn explorer_full_delegation_test ( ) {
170- let query_complexity_limit = 140 ;
171- let query_depth_limit = 30 ;
172169 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
173170 let mut stake_pool_owner = thor:: Wallet :: default ( ) ;
174171 let mut full_delegator = thor:: Wallet :: default ( ) ;
@@ -209,8 +206,8 @@ pub fn explorer_full_delegation_test() {
209206 . expect ( "Error while sending registration certificate for stake pool owner" ) ;
210207
211208 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 ,
214211 None ,
215212 ) ;
216213 let explorer_process = jormungandr. explorer ( params) ;
@@ -243,8 +240,6 @@ pub fn explorer_full_delegation_test() {
243240
244241#[ test]
245242pub fn explorer_split_delegation_test ( ) {
246- let query_complexity_limit = 140 ;
247- let query_depth_limit = 30 ;
248243 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
249244 let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
250245 let mut split_delegator = thor:: Wallet :: default ( ) ;
@@ -303,8 +298,8 @@ pub fn explorer_split_delegation_test() {
303298 . expect ( "Error while sending registration certificate for stake pool owner" ) ;
304299
305300 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 ,
308303 None ,
309304 ) ;
310305 let explorer_process = jormungandr. explorer ( params) ;
@@ -340,8 +335,6 @@ pub fn explorer_split_delegation_test() {
340335
341336#[ test]
342337pub fn explorer_pool_update_test ( ) {
343- let query_complexity_limit = 140 ;
344- let query_depth_limit = 30 ;
345338 let jcli: JCli = Default :: default ( ) ;
346339 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
347340 let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
@@ -372,8 +365,8 @@ pub fn explorer_pool_update_test() {
372365 ) ;
373366
374367 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 ,
377370 None ,
378371 ) ;
379372 let explorer_process = jormungandr. explorer ( params) ;
@@ -428,8 +421,6 @@ pub fn explorer_pool_update_test() {
428421
429422#[ test]
430423pub fn explorer_pool_retire_test ( ) {
431- let query_complexity_limit = 140 ;
432- let query_depth_limit = 30 ;
433424 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
434425 let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
435426 let first_stake_pool = StakePool :: new ( & first_stake_pool_owner) ;
@@ -458,8 +449,8 @@ pub fn explorer_pool_retire_test() {
458449 ) ;
459450
460451 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 ,
463454 None ,
464455 ) ;
465456 let explorer_process = jormungandr. explorer ( params) ;
@@ -507,8 +498,6 @@ pub fn explorer_pool_retire_test() {
507498pub fn explorer_evm_mapping_certificates_test ( ) {
508499 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
509500 let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
510- let query_complexity_limit = 70 ;
511- let query_depth_limit = 30 ;
512501
513502 let config = ConfigurationBuilder :: new ( )
514503 . with_funds ( vec ! [ first_stake_pool_owner. to_initial_fund( 1_000_000 ) ] )
@@ -534,8 +523,8 @@ pub fn explorer_evm_mapping_certificates_test() {
534523 ) ;
535524
536525 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 ,
539528 None ,
540529 ) ;
541530 let explorer_process = jormungandr. explorer ( params) ;
@@ -573,8 +562,6 @@ pub fn explorer_evm_mapping_certificates_test() {
573562
574563#[ test]
575564pub fn explorer_vote_plan_certificates_test ( ) {
576- let query_complexity_limit = 140 ;
577- let query_depth_limit = 30 ;
578565 let mut first_stake_pool_owner = thor:: Wallet :: default ( ) ;
579566 let bob = thor:: Wallet :: default ( ) ;
580567 let discrimination = Discrimination :: Test ;
@@ -612,8 +599,8 @@ pub fn explorer_vote_plan_certificates_test() {
612599 ) ;
613600
614601 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 ,
617604 None ,
618605 ) ;
619606 let explorer_process = jormungandr. explorer ( params) ;
@@ -643,8 +630,6 @@ pub fn explorer_vote_plan_certificates_test() {
643630
644631#[ test]
645632pub fn explorer_vote_cast_certificates_test ( ) {
646- let query_complexity_limit = 140 ;
647- let query_depth_limit = 30 ;
648633 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
649634 let mut alice = thor:: Wallet :: default ( ) ;
650635
@@ -699,8 +684,8 @@ pub fn explorer_vote_cast_certificates_test() {
699684 ) ;
700685
701686 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 ,
704689 None ,
705690 ) ;
706691 let explorer_process = jormungandr. explorer ( params) ;
@@ -725,8 +710,6 @@ pub fn explorer_vote_cast_certificates_test() {
725710
726711#[ test]
727712pub fn explorer_vote_tally_certificate_test ( ) {
728- let query_complexity_limit = 140 ;
729- let query_depth_limit = 30 ;
730713 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
731714 let mut alice = thor:: Wallet :: default ( ) ;
732715
@@ -787,8 +770,8 @@ pub fn explorer_vote_tally_certificate_test() {
787770 ) ;
788771
789772 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 ,
792775 None ,
793776 ) ;
794777 let explorer_process = jormungandr. explorer ( params) ;
@@ -823,8 +806,6 @@ pub fn explorer_vote_tally_certificate_test() {
823806#[ should_panic] //bug NPG-2742
824807#[ test]
825808pub fn explorer_update_proposal_certificate_test ( ) {
826- let query_complexity_limit = 140 ;
827- let query_depth_limit = 30 ;
828809 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
829810 let mut alice = thor:: Wallet :: default ( ) ;
830811 let mut bob = thor:: Wallet :: default ( ) ;
@@ -882,8 +863,8 @@ pub fn explorer_update_proposal_certificate_test() {
882863 ) ;
883864
884865 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 ,
887868 None ,
888869 ) ;
889870 let explorer_process = jormungandr. explorer ( params) ;
0 commit comments