@@ -567,41 +567,20 @@ impl BlobFactory {
567567 contract_address
568568 }
569569
570- fn make_operator_deploy_tx (
570+ fn make_operator_invoke_tx (
571571 & mut self ,
572- contract_to_deploy : FeatureContract ,
573- constructor_calldata : Calldata ,
572+ address : ContractAddress ,
573+ function_name : & str ,
574+ calldata : & [ Felt ] ,
574575 with_fee_charge : bool ,
575- ) -> ContractAddress {
576- let class_hash = contract_to_deploy. get_sierra ( ) . calculate_class_hash ( ) ;
577- let contract_address_salt = ContractAddressSalt :: default ( ) ;
578- let contract_address = calculate_contract_address (
579- contract_address_salt,
580- class_hash,
581- & constructor_calldata,
582- * OPERATOR_ADDRESS ,
583- )
584- . unwrap ( ) ;
576+ ) {
585577 let nonce = self . nonce_manager . next ( * OPERATOR_ADDRESS ) ;
586578 let resource_bounds = if with_fee_charge {
587579 * NON_TRIVIAL_RESOURCE_BOUNDS
588580 } else {
589581 AllResourceBounds :: new_unlimited_gas_no_fee_enforcement ( )
590582 } ;
591- let calldata = Self :: single_multicall_data (
592- * OPERATOR_ADDRESS ,
593- "deploy_contract" ,
594- & [
595- vec ! [
596- * class_hash,
597- contract_address_salt. 0 ,
598- Felt :: from( constructor_calldata. 0 . len( ) ) ,
599- ] ,
600- constructor_calldata. 0 . as_slice ( ) . to_vec ( ) ,
601- vec ! [ false . into( ) ] , // Deploy from zero.
602- ]
603- . concat ( ) ,
604- ) ;
583+ let calldata = Self :: single_multicall_data ( address, function_name, calldata) ;
605584 let rpc_tx_unsigned = InternalRpcInvokeTransactionV3 {
606585 sender_address : * OPERATOR_ADDRESS ,
607586 calldata,
@@ -630,6 +609,35 @@ impl BlobFactory {
630609 tx_hash,
631610 } ) ;
632611 self . next_txs . push ( ( executable. into ( ) , internal) ) ;
612+ }
613+
614+ fn make_operator_deploy_tx (
615+ & mut self ,
616+ contract_to_deploy : FeatureContract ,
617+ constructor_calldata : Calldata ,
618+ with_fee_charge : bool ,
619+ ) -> ContractAddress {
620+ let class_hash = contract_to_deploy. get_sierra ( ) . calculate_class_hash ( ) ;
621+ let contract_address_salt = ContractAddressSalt :: default ( ) ;
622+ let contract_address = calculate_contract_address (
623+ contract_address_salt,
624+ class_hash,
625+ & constructor_calldata,
626+ * OPERATOR_ADDRESS ,
627+ )
628+ . unwrap ( ) ;
629+ let calldata = [
630+ vec ! [ * class_hash, contract_address_salt. 0 , Felt :: from( constructor_calldata. 0 . len( ) ) ] ,
631+ constructor_calldata. 0 . as_slice ( ) . to_vec ( ) ,
632+ vec ! [ false . into( ) ] , // Deploy from zero.
633+ ]
634+ . concat ( ) ;
635+ self . make_operator_invoke_tx (
636+ * OPERATOR_ADDRESS ,
637+ "deploy_contract" ,
638+ & calldata,
639+ with_fee_charge,
640+ ) ;
633641 contract_address
634642 }
635643
0 commit comments