diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index f75153a01c..8446e47e48 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -28,8 +28,7 @@ use indexmap::IndexMap; use ledger_block::{ConfirmedTransaction, Rejected, Transaction}; use ledger_committee::{Committee, MIN_VALIDATOR_STAKE}; use ledger_store::{helpers::memory::ConsensusMemory, ConsensusStore}; -use synthesizer::{program::Program, Stack, vm::VM}; -use synthesizer::prelude::cost_in_microcredits; +use synthesizer::{prelude::cost_in_microcredits, program::Program, vm::VM, Stack}; #[test] fn test_load() { @@ -1422,7 +1421,7 @@ fn test_max_committee_limit_with_bonds() { Value::::from_str(&first_address.to_string()).unwrap(), Value::::from_str(&format!("{MIN_VALIDATOR_STAKE}u64")).unwrap(), ] - .iter(), + .iter(), None, 0, None, @@ -1465,7 +1464,7 @@ fn test_max_committee_limit_with_bonds() { Value::::from_str(&second_address.to_string()).unwrap(), Value::::from_str(&format!("{MIN_VALIDATOR_STAKE}u64")).unwrap(), ] - .iter(), + .iter(), None, 0, None, @@ -1524,7 +1523,7 @@ fn test_deployment_exceeding_max_transaction_spend() { finalize foo:{finalize_body}", )) - .unwrap(); + .unwrap(); // Initialize a stack for the program. let stack = Stack::::new(&ledger.vm().process().read(), &program).unwrap(); @@ -1556,9 +1555,8 @@ fn test_deployment_exceeding_max_transaction_spend() { assert!(ledger.vm().check_transaction(&deployment, None, rng).is_ok()); // Construct the next block. - let block = ledger - .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![deployment], rng) - .unwrap(); + let block = + ledger.prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![deployment], rng).unwrap(); // Check that the next block is valid. ledger.check_next_block(&block, rng).unwrap(); diff --git a/synthesizer/src/vm/deploy.rs b/synthesizer/src/vm/deploy.rs index 9350fe5007..f9e260793c 100644 --- a/synthesizer/src/vm/deploy.rs +++ b/synthesizer/src/vm/deploy.rs @@ -40,7 +40,7 @@ impl> VM { let owner = ProgramOwner::new(private_key, deployment_id, rng)?; // Compute the minimum deployment cost. - let (minimum_deployment_cost, _) = process::deployment_cost(&deployment)?; + let (minimum_deployment_cost, _) = deployment_cost(&deployment)?; // Authorize the fee. let fee_authorization = match fee_record { Some(record) => self.authorize_fee_private( diff --git a/synthesizer/src/vm/execute.rs b/synthesizer/src/vm/execute.rs index be37619227..2acd01d06f 100644 --- a/synthesizer/src/vm/execute.rs +++ b/synthesizer/src/vm/execute.rs @@ -45,7 +45,7 @@ impl> VM { let fee = match is_fee_required || is_priority_fee_declared { true => { // Compute the minimum execution cost. - let (minimum_execution_cost, (_, _)) = process::execution_cost(&self.process().read(), &execution)?; + let (minimum_execution_cost, (_, _)) = execution_cost(&self.process().read(), &execution)?; // Compute the execution ID. let execution_id = execution.to_execution_id()?; // Authorize the fee. diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 39085f9845..68ee600d11 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -55,7 +55,7 @@ use ledger_store::{ TransactionStore, TransitionStore, }; -use synthesizer_process::{Authorization, Process, Trace}; +use synthesizer_process::{deployment_cost, execution_cost, Authorization, Process, Trace}; use synthesizer_program::{FinalizeGlobalState, FinalizeOperation, FinalizeStoreTrait, Program}; use aleo_std::prelude::{finish, lap, timer}; @@ -397,7 +397,6 @@ pub(crate) mod test_helpers { use indexmap::IndexMap; use once_cell::sync::OnceCell; use std::borrow::Borrow; - use synthesizer_process::{cost_in_microcredits, Stack}; use synthesizer_snark::VerifyingKey; pub(crate) type CurrentNetwork = MainnetV0; @@ -1396,6 +1395,4 @@ finalize do: // Verify. vm.check_transaction(&transaction, None, rng).unwrap(); } - - } diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index b5284f09f5..285565325f 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -161,7 +161,7 @@ impl> VM { bail!("Failed to compute the Merkle root for deployment transaction '{id}'") }; // Compute the minimum deployment cost. - let (cost, _) = process::deployment_cost(deployment)?; + let (cost, _) = deployment_cost(deployment)?; // Ensure the fee is sufficient to cover the cost. if *fee.base_amount()? < cost { bail!("Transaction '{id}' has an insufficient base fee (deployment) - requires {cost} microcredits") @@ -183,7 +183,7 @@ impl> VM { // If the fee is required, then check that the base fee amount is satisfied. if is_fee_required { // Compute the execution cost. - let (cost, _) = process::execution_cost(&self.process().read(), execution)?; + let (cost, _) = execution_cost(&self.process().read(), execution)?; // Ensure the fee is sufficient to cover the cost. if *fee.base_amount()? < cost { bail!(