Skip to content

Commit 8a4d8d0

Browse files
committed
chore: use new snarkVM Process API
1 parent d5577d2 commit 8a4d8d0

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

cli/src/commands/developer/execute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use snarkvm::{
2626
Address,
2727
Identifier,
2828
Locator,
29-
Process,
29+
ProcessExclusiveGuard,
3030
ProgramID,
3131
VM,
3232
Value,
@@ -162,7 +162,7 @@ impl Execute {
162162
debug!("At block height {height} and consensus {version:?}");
163163

164164
// Load the program and it's imports into the process.
165-
load_program(&query, &mut vm.process().write(), &program_id, &endpoint)?;
165+
load_program(&query, &vm.process().lock(), &program_id, &endpoint)?;
166166
}
167167

168168
// Prepare the fee.
@@ -240,7 +240,7 @@ impl Execute {
240240
/// A helper function to recursively load the program and all of its imports into the process.
241241
fn load_program<N: Network>(
242242
query: &Query<N, BlockMemory<N>>,
243-
process: &mut Process<N>,
243+
process: &ProcessExclusiveGuard<N>,
244244
program_id: &ProgramID<N>,
245245
endpoint: &Uri,
246246
) -> Result<()> {

node/bft/ledger-service/src/ledger.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,7 @@ impl<N: Network, C: ConsensusStorage<N>> LedgerService<N> for CoreLedgerService<
447447
let id = transaction.id();
448448
match transaction {
449449
Transaction::Deploy(_, _, _, deployment, _) => {
450-
let (_, cost_details) =
451-
deployment_cost(&self.ledger.vm().process().read(), deployment, consensus_version)?;
450+
let (_, cost_details) = deployment_cost(self.ledger.vm().process(), deployment, consensus_version)?;
452451
let compute_spend = deploy_compute_cost_in_microcredits(cost_details, consensus_version)?;
453452
ensure!(
454453
compute_spend <= transaction_spend_limit,
@@ -457,8 +456,7 @@ impl<N: Network, C: ConsensusStorage<N>> LedgerService<N> for CoreLedgerService<
457456
Ok(compute_spend)
458457
}
459458
Transaction::Execute(_, _, execution, _) => {
460-
let (_, cost_details) =
461-
execution_cost(&self.ledger.vm().process().read(), execution, consensus_version)?;
459+
let (_, cost_details) = execution_cost(self.ledger.vm().process(), execution, consensus_version)?;
462460
let compute_spend = execute_compute_cost_in_microcredits(cost_details, consensus_version)?;
463461
if consensus_version >= ConsensusVersion::V11 {
464462
// From V11, add this check for consistency with our deployment checks.

0 commit comments

Comments
 (0)