Skip to content

Commit

Permalink
Fixing issue with PrivateKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Oct 25, 2023
1 parent 892a1ad commit 24d087e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 23 deletions.
8 changes: 0 additions & 8 deletions create-aleo-app/template-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RecordPlaintext>,
Expand All @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions wasm/src/programs/manager/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -70,7 +70,7 @@ impl ProgramManager {
let (state, execute) = state.execute_program(
function,
inputs,
private_key,
private_key.clone(),
proving_key,
verifying_key,
).await?;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -193,7 +193,7 @@ impl ProgramManager {
let (state, execute) = state.execute_program(
function,
inputs,
private_key,
private_key.clone(),
proving_key,
verifying_key,
).await?;
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/programs/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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?;
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 24d087e

Please sign in to comment.