@@ -36,7 +36,7 @@ const STARKNET_ESTIMATE_FEE: &str = "starknet_estimateFee";
3636const CARTRIDGE_ADD_EXECUTE_FROM_OUTSIDE : & str = "cartridge_addExecuteFromOutside" ;
3737const CARTRIDGE_ADD_EXECUTE_FROM_OUTSIDE_TX : & str = "cartridge_addExecuteOutsideTransaction" ;
3838
39- #[ derive( Debug , Clone ) ]
39+ #[ derive( Debug ) ]
4040struct ControllerDeploymentContext < Pool , PP , PF >
4141where
4242 Pool : TransactionPool + ' static ,
4949 deployer_private_key : SigningKey ,
5050}
5151
52- #[ derive( Debug , Clone ) ]
52+ impl < Pool , PP , PF > Clone for ControllerDeploymentContext < Pool , PP , PF >
53+ where
54+ Pool : TransactionPool + ' static ,
55+ PP : PendingBlockProvider ,
56+ PF : ProviderFactory ,
57+ {
58+ fn clone ( & self ) -> Self {
59+ Self {
60+ starknet : self . starknet . clone ( ) ,
61+ cartridge_api : self . cartridge_api . clone ( ) ,
62+ deployer_address : self . deployer_address ,
63+ deployer_private_key : self . deployer_private_key . clone ( ) ,
64+ }
65+ }
66+ }
67+
68+ #[ derive( Debug ) ]
5369pub struct ControllerDeploymentLayer < Pool , PP , PF >
5470where
5571 Pool : TransactionPool + ' static ,
@@ -97,10 +113,10 @@ where
97113 }
98114}
99115
100- #[ derive( Debug , Clone ) ]
116+ #[ derive( Debug ) ]
101117pub struct ControllerDeploymentService < S , Pool , PP , PF >
102118where
103- Pool : TransactionPool ,
119+ Pool : TransactionPool + ' static ,
104120 PP : PendingBlockProvider ,
105121 PF : ProviderFactory ,
106122{
@@ -379,7 +395,7 @@ where
379395 & self ,
380396 request : Request < ' a > ,
381397 ) -> impl Future < Output = Self :: MethodResponse > + Send + ' a {
382- let this = self . clone ( ) ;
398+ let this = ( * self ) . clone ( ) ;
383399
384400 async move {
385401 let method = request. method_name ( ) ;
@@ -421,6 +437,29 @@ where
421437 }
422438}
423439
440+ impl < Pool , PP , PF > Clone for ControllerDeploymentLayer < Pool , PP , PF >
441+ where
442+ Pool : TransactionPool + ' static ,
443+ PP : PendingBlockProvider ,
444+ PF : ProviderFactory ,
445+ {
446+ fn clone ( & self ) -> Self {
447+ Self { context : self . context . clone ( ) }
448+ }
449+ }
450+
451+ impl < S , Pool , PP , PF > Clone for ControllerDeploymentService < S , Pool , PP , PF >
452+ where
453+ S : Clone ,
454+ Pool : TransactionPool + ' static ,
455+ PP : PendingBlockProvider ,
456+ PF : ProviderFactory ,
457+ {
458+ fn clone ( & self ) -> Self {
459+ Self { context : self . context . clone ( ) , service : self . service . clone ( ) }
460+ }
461+ }
462+
424463#[ derive( Debug , thiserror:: Error ) ]
425464pub enum Error {
426465 #[ error( "cartridge api error: {0}" ) ]
0 commit comments