Skip to content

Commit 5a8e4bc

Browse files
updated estimateExecutionFee instance on website
1 parent 2ee0ebe commit 5a8e4bc

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

wasm/src/programs/manager/execute.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ use crate::{
4040
},
4141
};
4242
use snarkvm_algorithms::snark::varuna::VarunaVersion;
43-
use snarkvm_console::{network::{ConsensusVersion, Network}, program::Value};
44-
use snarkvm_ledger_query::QueryTrait;
45-
use snarkvm_synthesizer::{
46-
prelude::{InclusionVersion, execution_cost, execution_cost_for_authorization},
43+
use snarkvm_console::{
44+
network::{ConsensusVersion, Network},
45+
program::Value,
4746
};
47+
use snarkvm_ledger_query::QueryTrait;
48+
use snarkvm_synthesizer::prelude::{InclusionVersion, execution_cost, execution_cost_for_authorization};
4849

4950
use crate::types::native::{PrivateKeyNative, ViewKeyNative};
5051
use core::ops::Add;
@@ -339,10 +340,16 @@ impl ProgramManager {
339340
ProgramManager::resolve_imports(process, &program_native, imports)?;
340341
let rng = &mut StdRng::from_entropy();
341342

342-
let authorization =
343-
process.authorize::<CurrentAleo, StdRng>(private_key, program_id, function, inputs.iter().map(|v| Value::from_str(&v.as_string().unwrap_or_default())), rng).map_err(|e| e.to_string())?;
343+
let authorization = process
344+
.authorize::<CurrentAleo, StdRng>(
345+
private_key,
346+
program_id,
347+
function,
348+
inputs.iter().map(|v| Value::from_str(&v.as_string().unwrap_or_default())),
349+
rng,
350+
)
351+
.map_err(|e| e.to_string())?;
344352

345-
346353
let node_url = url.as_deref().unwrap_or(DEFAULT_URL);
347354
let latest_height = if let Some(offline_query) = offline_query.as_ref() {
348355
offline_query.current_block_height().map_err(|e| e.to_string())?

website/src/workers/worker.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,13 @@ self.addEventListener("message", (ev) => {
181181
}
182182

183183
// Estimate the execution fee
184-
const [provingKey, verifyingKey] = programManager.keyProvider.getKeys(cacheKey);
185184
let executeFee = await aleo.ProgramManagerBase.estimateExecutionFee(
186185
privateKeyObject,
187186
remoteProgram,
188187
aleoFunction,
189188
inputs,
190189
url,
191190
imports,
192-
provingKey,
193-
verifyingKey,
194191
undefined,
195192
edition
196193
);

0 commit comments

Comments
 (0)