@@ -68,7 +68,7 @@ use sp_std::vec::Vec;
6868pub use pallet:: * ;
6969pub use weights:: WeightInfo ;
7070
71- pub const UNSIGNED_TXS_PRIORITY : u64 = u64:: max_value ( ) ;
71+ pub const UNSIGNED_TXS_PRIORITY : u64 = u64:: MAX ;
7272/// Extra gas provided to EVM calls during solution execution.
7373const EXTRA_GAS : u64 = 1_000_000 ;
7474const LOG_TARGET : & str = "ice" ;
@@ -331,7 +331,7 @@ pub mod pallet {
331331 let mut exec_prices: BTreeMap < ( AssetId , AssetId ) , Price > = BTreeMap :: new ( ) ;
332332 for resolved_intent in & solution. resolved_intents {
333333 let ResolvedIntent { id, data : resolve } = resolved_intent;
334- log:: debug!( target: LOG_TARGET , "{:?}: sumbit_solution(), resolving intent, id: {:?}" , LOG_PREFIX , id ) ;
334+ log:: debug!( target: LOG_TARGET , "{LOG_PREFIX :?}: sumbit_solution(), resolving intent, id: {id :?}" ) ;
335335
336336 ensure ! ( processed_intents. insert( * id) , Error :: <T >:: DuplicateIntent ) ;
337337
@@ -356,7 +356,7 @@ pub mod pallet {
356356 let intent = pallet_intent:: Pallet :: < T > :: get_intent ( id) . ok_or ( Error :: < T > :: IntentNotFound ) ?;
357357 let surplus = pallet_intent:: Pallet :: < T > :: compute_surplus ( & intent, resolve)
358358 . ok_or ( Error :: < T > :: ArithmeticOverflow ) ?;
359- log:: debug!( target: LOG_TARGET , "{:?}: sumbit_solution(), id: {:?}, surplus: {:?}" , LOG_PREFIX , id , surplus ) ;
359+ log:: debug!( target: LOG_TARGET , "{LOG_PREFIX :?}: sumbit_solution(), id: {id :?}, surplus: {surplus :?}" ) ;
360360 exec_score = exec_score. checked_add ( surplus) . ok_or ( Error :: < T > :: ArithmeticOverflow ) ?;
361361
362362 pallet_intent:: Pallet :: < T > :: intent_resolved ( & owner, resolved_intent) ?;
@@ -416,7 +416,7 @@ pub mod pallet {
416416 match Solver :: < amm_simulator:: HydrationSimulator < T :: Simulator > > :: solve ( intents, state, matched_fee) {
417417 Ok ( solution) => Some ( solution) ,
418418 Err ( e) => {
419- log:: error!( target: OCW_LOG_TARGET , "{:?}: solver failed, err: {:?}" , LOG_PREFIX , e ) ;
419+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: solver failed, err: {e :?}" ) ;
420420 None
421421 }
422422 }
@@ -426,7 +426,7 @@ pub mod pallet {
426426
427427 let tx = <T as CreateBare < self :: Call < T > > >:: create_bare ( call. into ( ) ) ;
428428 if let Err ( e) = SubmitTransaction :: < T , Call < T > > :: submit_transaction ( tx) {
429- log:: error!( target: OCW_LOG_TARGET , "{:?}: submit_transaction failed (validate_unsigned rejected the solution), err: {:?}" , LOG_PREFIX , e ) ;
429+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: submit_transaction failed (validate_unsigned rejected the solution), err: {e :?}" ) ;
430430 } ;
431431 }
432432 }
@@ -533,9 +533,9 @@ impl<T: Config> Pallet<T> {
533533 let ed = <T as Config >:: RegistryHandler :: existential_deposit ( * asset) . unwrap_or ( Balance :: MAX ) ;
534534 if expected_fee >= ed && holding_pot != & fee_receiver {
535535 <T as Config >:: Currency :: transfer ( * asset, holding_pot, & fee_receiver, expected_fee, AllowDeath ) ?;
536- log:: debug!( target: LOG_TARGET , "{:?}: settle_matched_fees(), swept asset: {:?}, fee: {:?} -> {:?}" , LOG_PREFIX , asset , expected_fee , fee_receiver ) ;
536+ log:: debug!( target: LOG_TARGET , "{LOG_PREFIX :?}: settle_matched_fees(), swept asset: {asset :?}, fee: {expected_fee :?} -> {fee_receiver :?}" ) ;
537537 } else if expected_fee > 0 {
538- log:: debug!( target: LOG_TARGET , "{:?}: settle_matched_fees(), fee {:?} for asset {:?} below ED {:?} — retained in pot" , LOG_PREFIX , expected_fee , asset , ed ) ;
538+ log:: debug!( target: LOG_TARGET , "{LOG_PREFIX :?}: settle_matched_fees(), fee {expected_fee :?} for asset {asset :?} below ED {ed :?} — retained in pot" ) ;
539539 }
540540 }
541541 Ok ( ( ) )
@@ -630,35 +630,35 @@ impl<T: Config> Pallet<T> {
630630 // is enforced authoritatively in `submit_solution` via measured pool
631631 // output (see `settle_matched_fees`).
632632 for ResolvedIntent { id, data : resolve } in & solution. resolved_intents {
633- log:: debug!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), resolved intent, id: {:?}" , LOG_PREFIX , id ) ;
633+ log:: debug!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), resolved intent, id: {id :?}" ) ;
634634
635635 if let Err ( e) = Self :: validate_intent_amounts ( resolve) {
636- log:: error!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), intent {:?} failed amount validation: {:?}" , LOG_PREFIX , id , e ) ;
636+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), intent {id :?} failed amount validation: {e :?}" ) ;
637637 return Err ( e) ;
638638 }
639639
640640 let intent = pallet_intent:: Pallet :: < T > :: get_intent ( id) . ok_or_else ( || {
641- log:: error!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), intent {:?} not found in storage" , LOG_PREFIX , id ) ;
641+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), intent {id :?} not found in storage" ) ;
642642 Error :: < T > :: IntentNotFound
643643 } ) ?;
644644
645645 let surplus =
646646 pallet_intent:: Pallet :: < T > :: compute_surplus ( & intent, resolve) . ok_or ( Error :: < T > :: ArithmeticOverflow ) ?;
647- log:: debug!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), id: {:?}, surplus: {:?}" , LOG_PREFIX , id , surplus ) ;
647+ log:: debug!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), id: {id :?}, surplus: {surplus :?}" ) ;
648648 score = score. checked_add ( surplus) . ok_or ( Error :: < T > :: ArithmeticOverflow ) ?;
649649
650650 if !processed_intents. insert ( * id) {
651- log:: error!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), intent {:?} is duplicate" , LOG_PREFIX , id ) ;
651+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), intent {id :?} is duplicate" ) ;
652652 return Err ( Error :: < T > :: DuplicateIntent . into ( ) ) ;
653653 }
654654
655655 if let Err ( e) = pallet_intent:: Pallet :: < T > :: validate_resolve ( & intent, resolve) {
656- log:: error!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), intent {:?} failed resolve validation: {:?}" , LOG_PREFIX , id , e ) ;
656+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), intent {id :?} failed resolve validation: {e :?}" ) ;
657657 return Err ( e) ;
658658 }
659659
660660 if let Err ( e) = Self :: validate_price_consistency ( & mut exec_prices, resolve) {
661- log:: error!( target: OCW_LOG_TARGET , "{:?}: validate_unsigned_solution(), intent {:?} failed price consistency: {:?}" , LOG_PREFIX , id , e ) ;
661+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate_unsigned_solution(), intent {id :?} failed price consistency: {e :?}" ) ;
662662 return Err ( e) ;
663663 }
664664 }
@@ -695,17 +695,17 @@ impl<T: Config> Pallet<T> {
695695 let state = <<T as Config >:: Simulator as SimulatorConfig >:: Simulators :: initial_state ( ) ;
696696
697697 let Some ( solution) = solve ( intents, state) else {
698- log:: debug!( target: OCW_LOG_TARGET , "{:?}: solver returned no solution, block: {:?}" , LOG_PREFIX , block_no ) ;
698+ log:: debug!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: solver returned no solution, block: {block_no :?}" ) ;
699699 return None ;
700700 } ;
701701
702702 if solution. resolved_intents . is_empty ( ) {
703- log:: debug!( target: OCW_LOG_TARGET , "{:?}: solver returned empty solution (no resolvable intents), block: {:?}" , LOG_PREFIX , block_no ) ;
703+ log:: debug!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: solver returned empty solution (no resolvable intents), block: {block_no :?}" ) ;
704704 return None ;
705705 }
706706
707707 if let Err ( e) = Self :: validate_unsigned_solution ( & solution) {
708- log:: error!( target: OCW_LOG_TARGET , "{:?}: validate solution, err: {:?}, block: {:?}" , LOG_PREFIX , e , block_no ) ;
708+ log:: error!( target: OCW_LOG_TARGET , "{LOG_PREFIX :?}: validate solution, err: {e :?}, block: {block_no :?}" ) ;
709709 return None ;
710710 }
711711
0 commit comments