@@ -536,15 +536,6 @@ pub struct GasPriceOracleOptions {
536536 pub l1_strk_data_gas_price : Option < GasPrice > ,
537537}
538538
539- #[ cfg( feature = "cartridge" ) ]
540- #[ derive( Debug , Args , Clone , Serialize , Deserialize , PartialEq ) ]
541- #[ command( next_help_heading = "Cartridge options" ) ]
542- pub struct CartridgeOptions {
543- /// Declare all versions of the Controller class at genesis.
544- #[ arg( long = "cartridge.controllers" ) ]
545- pub controllers : bool ,
546- }
547-
548539#[ cfg( feature = "paymaster" ) ]
549540#[ derive( Debug , Args , Clone , Serialize , Deserialize , PartialEq ) ]
550541#[ command( next_help_heading = "Paymaster options" ) ]
@@ -589,29 +580,6 @@ pub struct PaymasterOptions {
589580 #[ arg( long = "paymaster.bin" , value_name = "PATH" , id = "paymaster_bin" ) ]
590581 #[ serde( default ) ]
591582 pub bin : Option < PathBuf > ,
592-
593- /// Enable Cartridge paymaster
594- #[ cfg( feature = "cartridge" ) ]
595- #[ arg( requires = "paymaster_enabled" ) ]
596- #[ arg( long = "paymaster.cartridge" ) ]
597- #[ serde( default ) ]
598- pub cartridge_paymaster : bool ,
599-
600- /// The base URL for the Cartridge API.
601- ///
602- /// This is used to fetch the calldata for the constructor of the given controller
603- /// address (at the moment). Must be configurable for local development
604- /// with local cartridge API.
605- #[ cfg( feature = "cartridge" ) ]
606- #[ arg( long = "paymaster.cartridge-api" ) ]
607- #[ arg( default_value = "https://api.cartridge.gg" ) ]
608- #[ arg( requires_all = [ "paymaster_enabled" , "cartridge_paymaster" ] ) ]
609- #[ serde( default = "default_api_url" ) ]
610- pub cartridge_api : Url ,
611-
612- #[ cfg( feature = "vrf" ) ]
613- #[ command( flatten) ]
614- pub vrf : VrfOptions ,
615583}
616584
617585#[ cfg( feature = "paymaster" ) ]
@@ -642,6 +610,47 @@ impl PaymasterOptions {
642610 if self . bin . is_none ( ) {
643611 self . bin = other. bin . clone ( ) ;
644612 }
613+ }
614+ }
615+ }
616+
617+ #[ cfg( feature = "cartridge" ) ]
618+ #[ derive( Debug , Args , Clone , Serialize , Deserialize , PartialEq ) ]
619+ #[ command( next_help_heading = "Cartridge options" ) ]
620+ pub struct CartridgeOptions {
621+ /// Declare all versions of the Controller class at genesis.
622+ #[ arg( long = "cartridge.controllers" ) ]
623+ pub controllers : bool ,
624+
625+ /// Enable Cartridge paymaster
626+ #[ arg( requires = "paymaster_enabled" ) ]
627+ #[ arg( long = "cartridge.paymaster" , id = "cartridge_paymaster" ) ]
628+ #[ serde( default ) ]
629+ pub paymaster : bool ,
630+
631+ /// The base URL for the Cartridge API.
632+ ///
633+ /// This is used to fetch the calldata for the constructor of the given controller
634+ /// address (at the moment). Must be configurable for local development
635+ /// with local cartridge API.
636+ #[ arg( long = "cartridge.api" ) ]
637+ #[ arg( default_value = "https://api.cartridge.gg" ) ]
638+ #[ arg( requires = "cartridge_paymaster" ) ]
639+ #[ serde( default = "default_api_url" ) ]
640+ pub cartridge_api : Url ,
641+
642+ #[ cfg( feature = "vrf" ) ]
643+ #[ command( flatten) ]
644+ pub vrf : VrfOptions ,
645+ }
646+
647+ #[ cfg( feature = "cartridge" ) ]
648+ impl CartridgeOptions {
649+ pub fn merge ( & mut self , other : Option < & Self > ) {
650+ if let Some ( other) = other {
651+ if !self . controllers {
652+ self . controllers = other. controllers ;
653+ }
645654
646655 if self . vrf == VrfOptions :: default ( ) {
647656 self . vrf = other. vrf . clone ( ) ;
@@ -650,11 +659,24 @@ impl PaymasterOptions {
650659 }
651660}
652661
662+ #[ cfg( feature = "cartridge" ) ]
663+ impl Default for CartridgeOptions {
664+ fn default ( ) -> Self {
665+ CartridgeOptions {
666+ controllers : false ,
667+ paymaster : false ,
668+ cartridge_api : default_api_url ( ) ,
669+ #[ cfg( feature = "vrf" ) ]
670+ vrf : VrfOptions :: default ( ) ,
671+ }
672+ }
673+ }
674+
653675#[ cfg( feature = "vrf" ) ]
654676#[ derive( Debug , Default , Args , Clone , Serialize , Deserialize , PartialEq ) ]
655- #[ command( next_help_heading = "VRF options" ) ]
677+ #[ command( next_help_heading = "Cartridge VRF options" ) ]
656678pub struct VrfOptions {
657- /// Enable the VRF service.
679+ /// Enable the Cartridge VRF service.
658680 ///
659681 /// By default, the VRF runs as a sidecar process. If `--vrf.url` is provided,
660682 /// it will connect to an external VRF service instead.
@@ -712,38 +734,10 @@ impl VrfOptions {
712734 }
713735}
714736
715- #[ cfg( feature = "cartridge" ) ]
716- impl CartridgeOptions {
717- pub fn merge ( & mut self , other : Option < & Self > ) {
718- if let Some ( other) = other {
719- if !self . controllers {
720- self . controllers = other. controllers ;
721- }
722- }
723- }
724- }
725-
726- #[ cfg( feature = "cartridge" ) ]
727- impl Default for CartridgeOptions {
728- fn default ( ) -> Self {
729- CartridgeOptions { controllers : false }
730- }
731- }
732-
733737#[ cfg( feature = "paymaster" ) ]
734738impl Default for PaymasterOptions {
735739 fn default ( ) -> Self {
736- Self {
737- enabled : false ,
738- url : None ,
739- api_key : None ,
740- bin : None ,
741- price_api_key : None ,
742- cartridge_paymaster : false ,
743- cartridge_api : default_api_url ( ) ,
744- #[ cfg( feature = "vrf" ) ]
745- vrf : VrfOptions :: default ( ) ,
746- }
740+ Self { enabled : false , url : None , api_key : None , bin : None , price_api_key : None }
747741 }
748742}
749743
0 commit comments