diff --git a/create-aleo-app/template-node/index.js b/create-aleo-app/template-node/index.js index aee41705c..8f0341417 100644 --- a/create-aleo-app/template-node/index.js +++ b/create-aleo-app/template-node/index.js @@ -40,15 +40,7 @@ async function localProgramExecution(program, aleoFunction, inputs) { undefined, keyProviderParams, ); - console.log(executionResponse.getOutputs()) - executionResponse = await programManager.executeOffline( - hello_hello_program, - "hello", - ["5u32", "5u32"], - false, - keyProviderParams, - ); return executionResponse.getOutputs(); } diff --git a/wasm/src/programs/manager/deploy.rs b/wasm/src/programs/manager/deploy.rs index fd3e1fd7f..3f3ffda12 100644 --- a/wasm/src/programs/manager/deploy.rs +++ b/wasm/src/programs/manager/deploy.rs @@ -47,7 +47,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = buildDeploymentTransaction)] #[allow(clippy::too_many_arguments)] pub async fn deploy( - private_key: PrivateKey, + private_key: &PrivateKey, program: String, fee_credits: f64, fee_record: Option, @@ -69,7 +69,7 @@ impl ProgramManager { let (state, fee) = state.execute_fee( deploy.execution_id()?, url, - private_key, + private_key.clone(), fee_microcredits, fee_record, fee_proving_key, diff --git a/wasm/src/programs/manager/execute.rs b/wasm/src/programs/manager/execute.rs index 1cf33121c..375480f34 100644 --- a/wasm/src/programs/manager/execute.rs +++ b/wasm/src/programs/manager/execute.rs @@ -51,7 +51,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = executeFunctionOffline)] #[allow(clippy::too_many_arguments)] pub async fn execute_function_offline( - private_key: PrivateKey, + private_key: &PrivateKey, program: String, function: String, inputs: Array, @@ -70,7 +70,7 @@ impl ProgramManager { let (state, execute) = state.execute_program( function, inputs, - private_key, + private_key.clone(), proving_key, verifying_key, ).await?; @@ -108,7 +108,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = buildExecutionTransaction)] #[allow(clippy::too_many_arguments)] pub async fn execute( - private_key: PrivateKey, + private_key: &PrivateKey, program: String, function: String, inputs: Array, @@ -142,7 +142,7 @@ impl ProgramManager { let (_state, fee) = state.execute_fee( execution.execution_id()?, url, - private_key, + private_key.clone(), fee_microcredits, fee_record, fee_proving_key, @@ -172,7 +172,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = estimateExecutionFee)] #[allow(clippy::too_many_arguments)] pub async fn estimate_execution_fee( - private_key: PrivateKey, + private_key: &PrivateKey, program: String, function: String, inputs: Array, @@ -193,7 +193,7 @@ impl ProgramManager { let (state, execute) = state.execute_program( function, inputs, - private_key, + private_key.clone(), proving_key, verifying_key, ).await?; diff --git a/wasm/src/programs/manager/join.rs b/wasm/src/programs/manager/join.rs index e5630c75b..fe3fdc400 100644 --- a/wasm/src/programs/manager/join.rs +++ b/wasm/src/programs/manager/join.rs @@ -43,7 +43,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = buildJoinTransaction)] #[allow(clippy::too_many_arguments)] pub async fn join( - private_key: PrivateKey, + private_key: &PrivateKey, record_1: RecordPlaintext, record_2: RecordPlaintext, fee_credits: f64, @@ -87,7 +87,7 @@ impl ProgramManager { let (_state, fee) = state.execute_fee( execution.execution_id()?, url, - private_key, + private_key.clone(), fee_microcredits, fee_record, fee_proving_key, diff --git a/wasm/src/programs/manager/mod.rs b/wasm/src/programs/manager/mod.rs index 75530469a..345f8d8e4 100644 --- a/wasm/src/programs/manager/mod.rs +++ b/wasm/src/programs/manager/mod.rs @@ -576,7 +576,7 @@ impl ProgramManager { /// @param imports {Object | undefined} The imports for the program #[wasm_bindgen(js_name = "synthesizeKeyPair")] pub async fn synthesize_keypair( - private_key: PrivateKey, + private_key: &PrivateKey, program: String, function_id: String, inputs: js_sys::Array, diff --git a/wasm/src/programs/manager/split.rs b/wasm/src/programs/manager/split.rs index cd260ff77..a7de6af43 100644 --- a/wasm/src/programs/manager/split.rs +++ b/wasm/src/programs/manager/split.rs @@ -41,7 +41,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = buildSplitTransaction)] #[allow(clippy::too_many_arguments)] pub async fn split( - private_key: PrivateKey, + private_key: &PrivateKey, split_amount: f64, amount_record: RecordPlaintext, url: String, @@ -63,7 +63,7 @@ impl ProgramManager { let (state, mut execute) = state.execute_program( "split".to_string(), inputs, - private_key, + private_key.clone(), split_proving_key, split_verifying_key, ).await?; diff --git a/wasm/src/programs/manager/transfer.rs b/wasm/src/programs/manager/transfer.rs index a780d8360..986b0e76f 100644 --- a/wasm/src/programs/manager/transfer.rs +++ b/wasm/src/programs/manager/transfer.rs @@ -46,7 +46,7 @@ impl ProgramManager { #[wasm_bindgen(js_name = buildTransferTransaction)] #[allow(clippy::too_many_arguments)] pub async fn transfer( - private_key: PrivateKey, + private_key: &PrivateKey, amount_credits: f64, recipient: String, transfer_type: &str, @@ -132,7 +132,7 @@ impl ProgramManager { let (_state, fee) = state.execute_fee( execution.execution_id()?, url, - private_key, + private_key.clone(), fee_microcredits, fee_record, fee_proving_key,