diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57a2bf3e4..fdb51764a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: matrix: toolchain: [stable, nightly] os: [ubuntu] - args: [--release --features testing] + args: [--release --features concurrent testing] timeout-minutes: 30 steps: - uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index 69773e055..247d05cbf 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,4 @@ watch: cargo watch -w miden-lib/asm -x build test: - cargo test --features testing + cargo test --release --features concurrent testing \ No newline at end of file diff --git a/mock/src/constants.rs b/mock/src/constants.rs index 3246817f4..d5d234b3a 100644 --- a/mock/src/constants.rs +++ b/mock/src/constants.rs @@ -1,5 +1,5 @@ use miden_objects::{ - accounts::{AccountId, AccountType, SlotItem, StorageSlotType}, + accounts::{get_account_seed_single, AccountId, AccountType, SlotItem, StorageSlotType}, assets::{Asset, NonFungibleAsset, NonFungibleAssetDetails}, Felt, FieldElement, Word, ZERO, }; @@ -148,7 +148,7 @@ pub fn generate_account_seed(account_seed_type: AccountSeedType) -> (AccountId, ), }; - let seed = AccountId::get_account_seed( + let seed = get_account_seed_single( init_seed, account_type, true, diff --git a/objects/src/accounts/mod.rs b/objects/src/accounts/mod.rs index ee464c492..630ccb2eb 100644 --- a/objects/src/accounts/mod.rs +++ b/objects/src/accounts/mod.rs @@ -19,7 +19,7 @@ pub mod delta; pub use delta::{AccountDelta, AccountStorageDelta, AccountVaultDelta}; mod seed; -pub use seed::get_account_seed; +pub use seed::{get_account_seed, get_account_seed_single}; mod storage; pub use storage::{AccountStorage, SlotItem, StorageSlotType}; diff --git a/objects/src/accounts/seed.rs b/objects/src/accounts/seed.rs index cfad7544b..f7e68e4f4 100644 --- a/objects/src/accounts/seed.rs +++ b/objects/src/accounts/seed.rs @@ -13,7 +13,7 @@ use super::{compute_digest, AccountError, AccountId, AccountType, Digest, Felt, // -------------------------------------------------------------------------------------------- /// Finds and returns a seed suitable for creating an account ID for the specified account type -/// using the provided initial seed as a starting point. +/// using the provided initial seed as a starting point. Using multi-threading. #[cfg(feature = "concurrent")] pub fn get_account_seed( init_seed: [u8; 32], @@ -114,8 +114,6 @@ pub fn get_account_seed_inner( } } -/// Finds and returns a seed suitable for creating an account ID for the specified account type -/// using the provided initial seed as a starting point. #[cfg(not(feature = "concurrent"))] pub fn get_account_seed( init_seed: [u8; 32], @@ -123,6 +121,18 @@ pub fn get_account_seed( on_chain: bool, code_root: Digest, storage_root: Digest, +) -> Result { + get_account_seed_single(init_seed, account_type, on_chain, code_root, storage_root) +} + +/// Finds and returns a seed suitable for creating an account ID for the specified account type +/// using the provided initial seed as a starting point. Using a single thread. +pub fn get_account_seed_single( + init_seed: [u8; 32], + account_type: AccountType, + on_chain: bool, + code_root: Digest, + storage_root: Digest, ) -> Result { let init_seed: Vec<[u8; 8]> = init_seed.chunks(8).map(|chunk| chunk.try_into().unwrap()).collect();