@@ -560,41 +560,20 @@ impl BlobFactory {
560560 contract_address
561561 }
562562
563- fn make_operator_deploy_tx (
563+ fn make_operator_invoke_tx (
564564 & mut self ,
565- contract_to_deploy : FeatureContract ,
566- constructor_calldata : Calldata ,
565+ address : ContractAddress ,
566+ function_name : & str ,
567+ calldata : & [ Felt ] ,
567568 with_fee_charge : bool ,
568- ) -> ContractAddress {
569- let class_hash = contract_to_deploy. get_sierra ( ) . calculate_class_hash ( ) ;
570- let contract_address_salt = ContractAddressSalt :: default ( ) ;
571- let contract_address = calculate_contract_address (
572- contract_address_salt,
573- class_hash,
574- & constructor_calldata,
575- * OPERATOR_ADDRESS ,
576- )
577- . unwrap ( ) ;
569+ ) {
578570 let nonce = self . nonce_manager . next ( * OPERATOR_ADDRESS ) ;
579571 let resource_bounds = if with_fee_charge {
580572 * NON_TRIVIAL_RESOURCE_BOUNDS
581573 } else {
582574 AllResourceBounds :: new_unlimited_gas_no_fee_enforcement ( )
583575 } ;
584- let calldata = Self :: single_multicall_data (
585- * OPERATOR_ADDRESS ,
586- "deploy_contract" ,
587- & [
588- vec ! [
589- * class_hash,
590- contract_address_salt. 0 ,
591- Felt :: from( constructor_calldata. 0 . len( ) ) ,
592- ] ,
593- constructor_calldata. 0 . as_slice ( ) . to_vec ( ) ,
594- vec ! [ false . into( ) ] , // Deploy from zero.
595- ]
596- . concat ( ) ,
597- ) ;
576+ let calldata = Self :: single_multicall_data ( address, function_name, calldata) ;
598577 let rpc_tx_unsigned = InternalRpcInvokeTransactionV3 {
599578 sender_address : * OPERATOR_ADDRESS ,
600579 calldata,
@@ -623,6 +602,35 @@ impl BlobFactory {
623602 tx_hash,
624603 } ) ;
625604 self . next_txs . push ( ( executable. into ( ) , internal) ) ;
605+ }
606+
607+ fn make_operator_deploy_tx (
608+ & mut self ,
609+ contract_to_deploy : FeatureContract ,
610+ constructor_calldata : Calldata ,
611+ with_fee_charge : bool ,
612+ ) -> ContractAddress {
613+ let class_hash = contract_to_deploy. get_sierra ( ) . calculate_class_hash ( ) ;
614+ let contract_address_salt = ContractAddressSalt :: default ( ) ;
615+ let contract_address = calculate_contract_address (
616+ contract_address_salt,
617+ class_hash,
618+ & constructor_calldata,
619+ * OPERATOR_ADDRESS ,
620+ )
621+ . unwrap ( ) ;
622+ let calldata = [
623+ vec ! [ * class_hash, contract_address_salt. 0 , Felt :: from( constructor_calldata. 0 . len( ) ) ] ,
624+ constructor_calldata. 0 . as_slice ( ) . to_vec ( ) ,
625+ vec ! [ false . into( ) ] , // Deploy from zero.
626+ ]
627+ . concat ( ) ;
628+ self . make_operator_invoke_tx (
629+ * OPERATOR_ADDRESS ,
630+ "deploy_contract" ,
631+ & calldata,
632+ with_fee_charge,
633+ ) ;
626634 contract_address
627635 }
628636
0 commit comments