(
process: &mut ProcessNative,
authorization: Authorization,
fee_authorization: Option<Authorization>,
proving_key: Option<ProvingKey>,
verifying_key: Option<Ve
| 755 | /// resolving imports, inserting keys) before calling this method. |
| 756 | #[allow(clippy::too_many_arguments)] |
| 757 | async fn execute_authorization_inner( |
| 758 | process: &mut ProcessNative, |
| 759 | authorization: Authorization, |
| 760 | fee_authorization: Option<Authorization>, |
| 761 | proving_key: Option<ProvingKey>, |
| 762 | verifying_key: Option<VerifyingKey>, |
| 763 | fee_proving_key: Option<ProvingKey>, |
| 764 | fee_verifying_key: Option<VerifyingKey>, |
| 765 | url: Option<String>, |
| 766 | query: Option<QueryOption>, |
| 767 | edition: u16, |
| 768 | program_native: ProgramNative, |
| 769 | ) -> Result<Transaction, String> { |
| 770 | let node_url = url.as_deref().unwrap_or(DEFAULT_URL); |
| 771 | let program_id = program_native.id().to_string(); |
| 772 | |
| 773 | // Get the latest height. |
| 774 | log("Checking the latest block height"); |
| 775 | let latest_height = if let Some(ref query) = query { |
| 776 | query.current_block_height_async().await.map_err(|e| e.to_string())? |
| 777 | } else { |
| 778 | latest_block_height(node_url).await.map_err(|e| e.to_string())? |
| 779 | }; |
| 780 | |
| 781 | // Get the function name. |
| 782 | log("Checking the function name is valid."); |
| 783 | let function_name = IdentifierNative::from_str(&authorization.function_name()?).map_err(|e| e.to_string())?; |
| 784 | |
| 785 | // Add the top-level program if not already present. |
| 786 | if program_id != "credits.aleo" && !process.contains_program(program_native.id()) { |
| 787 | process.lock().add_program_with_edition(&program_native, edition).map_err(|e| e.to_string())?; |
| 788 | } |
| 789 | |
| 790 | // Insert the proving key if provided. |
| 791 | if let Some(proving_key) = proving_key { |
| 792 | if Self::contains_key(process, program_native.id(), &function_name) { |
| 793 | log(&format!( |
| 794 | "Proving & verifying keys were specified for {program_id} - {function_name:?} but a key already exists in the cache. Using cached keys" |
| 795 | )); |
| 796 | } else { |
| 797 | log(&format!( |
| 798 | "Inserting externally provided proving and verifying keys for {program_id} - {function_name:?}" |
| 799 | )); |
| 800 | process |
| 801 | .insert_proving_key(program_native.id(), &function_name, ProvingKeyNative::from(proving_key)) |
| 802 | .map_err(|e| e.to_string())?; |
| 803 | if let Some(verifying_key) = verifying_key { |
| 804 | process |
| 805 | .insert_verifying_key( |
| 806 | program_native.id(), |
| 807 | &function_name, |
| 808 | VerifyingKeyNative::from(verifying_key), |
| 809 | ) |
| 810 | .map_err(|e| e.to_string())?; |
| 811 | } |
| 812 | } |
| 813 | }; |
| 814 |
nothing calls this directly
no test coverage detected