@@ -180,72 +180,6 @@ where
180180 . with_account_validation ( should_validate)
181181 . with_nonce_check ( false ) ;
182182
183- // Hook the estimate fee to pre-deploy the controller contract
184- // and enhance UX on the client side.
185- // Refer to the `handle_cartridge_controller_deploy` function in `cartridge.rs`
186- // for more details.
187- #[ cfg( feature = "cartridge" ) ]
188- let transactions = if let Some ( paymaster) = & self . inner . config . paymaster {
189- use std:: sync:: Arc ;
190-
191- let paymaster_address = paymaster. paymaster_address ;
192- let paymaster_private_key = paymaster. paymaster_private_key ;
193-
194- let state =
195- self . storage ( ) . provider ( ) . latest ( ) . map ( Arc :: new) . map_err ( StarknetApiError :: from) ?;
196-
197- let mut ctrl_deploy_txs = Vec :: new ( ) ;
198-
199- // Check if any of the transactions are sent from an address associated with a Cartridge
200- // Controller account. If yes, we craft a Controller deployment transaction
201- // for each of the unique sender and push it at the beginning of the
202- // transaction list so that all the requested transactions are executed against a state
203- // with the Controller accounts deployed.
204-
205- let paymaster_nonce = match self . nonce_at ( block_id, paymaster_address) . await {
206- Ok ( nonce) => nonce,
207- Err ( err) => match err {
208- StarknetApiError :: ContractNotFound => {
209- return Err ( StarknetApiError :: unexpected (
210- "Cartridge paymaster account doesn't exist" ,
211- )
212- . into ( ) ) ;
213- }
214- _ => return Err ( ErrorObjectOwned :: from ( err) ) ,
215- } ,
216- } ;
217-
218- for tx in & transactions {
219- let api = :: cartridge:: CartridgeApiClient :: new ( paymaster. cartridge_api_url . clone ( ) ) ;
220-
221- let deploy_controller_tx =
222- cartridge:: get_controller_deploy_tx_if_controller_address (
223- paymaster_address,
224- paymaster_private_key,
225- paymaster_nonce,
226- tx,
227- self . inner . chain_spec . id ( ) ,
228- state. clone ( ) ,
229- & api,
230- )
231- . await
232- . map_err ( StarknetApiError :: from) ?;
233-
234- if let Some ( tx) = deploy_controller_tx {
235- ctrl_deploy_txs. push ( tx) ;
236- }
237- }
238-
239- if !ctrl_deploy_txs. is_empty ( ) {
240- ctrl_deploy_txs. extend ( transactions) ;
241- ctrl_deploy_txs
242- } else {
243- transactions
244- }
245- } else {
246- transactions
247- } ;
248-
249183 let permit =
250184 self . inner . estimate_fee_permit . acquire ( ) . await . map_err ( |e| {
251185 StarknetApiError :: unexpected ( format ! ( "Failed to acquire permit: {e}" ) )
0 commit comments