diff --git a/core/Cargo.toml b/core/Cargo.toml index c4d1b5de1f..b86445cef9 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -23,10 +23,10 @@ sve = ["miden-crypto/sve", "std"] [dependencies] math = { package = "winter-math", version = "0.6", default-features = false } -miden-crypto = { package = "miden-crypto", version = "0.7", default-features = false } +miden-crypto = { git = "https://github.com/0xPolygonMiden/crypto", branch = "next", default-features = false } winter-crypto = { package = "winter-crypto", version = "0.6", default-features = false } winter-utils = { package = "winter-utils", version = "0.6", default-features = false } [dev-dependencies] -proptest = "1.1" +proptest = "1.3" rand_utils = { version = "0.6", package = "winter-rand-utils" } diff --git a/stdlib/tests/collections/mmr.rs b/stdlib/tests/collections/mmr.rs index c56cc5b129..d70fd31a51 100644 --- a/stdlib/tests/collections/mmr.rs +++ b/stdlib/tests/collections/mmr.rs @@ -560,15 +560,10 @@ fn test_mmr_pack_roundtrip() { let advice_stack = &[]; let store = MerkleStore::new(); - let mut hash_data = accumulator.peaks.clone(); + let mut hash_data = accumulator.peaks().to_vec(); hash_data.resize(16, RpoDigest::default()); let mut map_data: Vec = Vec::with_capacity(hash_data.len() + 1); - map_data.extend_from_slice(&[ - Felt::new(accumulator.num_leaves.try_into().unwrap()), - ZERO, - ZERO, - ZERO, - ]); + map_data.extend_from_slice(&[Felt::new(accumulator.num_leaves() as u64), ZERO, ZERO, ZERO]); map_data.extend_from_slice(digests_to_elements(&hash_data).as_ref()); let advice_map: &[([u8; 32], Vec)] = &[ @@ -589,9 +584,9 @@ fn test_mmr_pack_roundtrip() { let mut expect_memory: Vec = Vec::new(); // first the number of leaves - expect_memory.extend_from_slice(&[accumulator.num_leaves as u64, 0, 0, 0]); + expect_memory.extend_from_slice(&[accumulator.num_leaves() as u64, 0, 0, 0]); // followed by the peaks - expect_memory.extend(digests_to_ints(&accumulator.peaks)); + expect_memory.extend(digests_to_ints(&accumulator.peaks())); // followed by padding data let size = 4 + 16 * 4; expect_memory.resize(size, 0); @@ -685,9 +680,9 @@ fn test_mmr_two() { mmr.add([Felt::new(5), Felt::new(6), Felt::new(7), Felt::new(8)].into()); let accumulator = mmr.accumulator(); - let peak = accumulator.peaks[0]; + let peak = accumulator.peaks()[0]; - let num_leaves = accumulator.num_leaves.try_into().unwrap(); + let num_leaves = accumulator.num_leaves() as u64; let mut expected_memory = vec![num_leaves, 0, 0, 0]; expected_memory.extend(peak.iter().map(|v| v.as_int())); @@ -726,9 +721,9 @@ fn test_mmr_large() { let accumulator = mmr.accumulator(); - let num_leaves = accumulator.num_leaves.try_into().unwrap(); + let num_leaves = accumulator.num_leaves() as u64; let mut expected_memory = vec![num_leaves, 0, 0, 0]; - expected_memory.extend(digests_to_ints(&accumulator.peaks)); + expected_memory.extend(digests_to_ints(&accumulator.peaks())); let expect_stack: Vec = accumulator.hash_peaks().iter().rev().map(|v| v.as_int()).collect(); @@ -761,11 +756,11 @@ fn test_mmr_large_add_roundtrip() { let advice_stack = &[]; let store = MerkleStore::new(); - let mut hash_data = old_accumulator.peaks.clone(); + let mut hash_data = old_accumulator.peaks().to_vec(); hash_data.resize(16, RpoDigest::default()); let mut map_data: Vec = Vec::with_capacity(hash_data.len() + 1); - let num_leaves: u64 = old_accumulator.num_leaves as u64; + let num_leaves = old_accumulator.num_leaves() as u64; map_data.extend_from_slice(&[Felt::from(num_leaves), ZERO, ZERO, ZERO]); map_data.extend_from_slice(&digests_to_elements(&hash_data)); @@ -789,9 +784,9 @@ fn test_mmr_large_add_roundtrip() { mmr.add([ZERO, ZERO, ZERO, Felt::new(8)].into()); let new_accumulator = mmr.accumulator(); - let num_leaves = new_accumulator.num_leaves.try_into().unwrap(); + let num_leaves = new_accumulator.num_leaves() as u64; let mut expected_memory = vec![num_leaves, 0, 0, 0]; - let mut new_peaks = new_accumulator.peaks.clone(); + let mut new_peaks = new_accumulator.peaks().to_vec(); // make sure the old peaks are zeroed new_peaks.resize(16, RpoDigest::default()); expected_memory.extend(digests_to_ints(&new_peaks)); diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 8aeaa89837..ddb3de3410 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -25,5 +25,5 @@ vm-core = { package = "miden-core", path = "../core", version = "0.8", default-f winter-prover = { package = "winter-prover", version = "0.6", default-features = false } [target.'cfg(not(target_family = "wasm"))'.dependencies] -proptest = { version = "1.3" } +proptest = "1.3" rand-utils = { package = "winter-rand-utils", version = "0.6" }