Skip to content

Commit

Permalink
fix: tree max_height tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cchudant committed Sep 30, 2024
1 parent bcab08a commit 956b537
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/tests/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn init_test(

let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(db, RocksDBConfig::default()), config, 251)
BonsaiStorage::new(RocksDB::new(db, RocksDBConfig::default()), config, 24)
.expect("Failed to create BonsaiStorage");

let mut id_builder = BasicIdBuilder::new();
Expand Down
2 changes: 1 addition & 1 deletion src/tests/proptest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl MerkleTreeInsertProblem {
let mut ckv = HashMap::new();

// apply steps
let mut tree = MerkleTree::<Pedersen>::new(smallvec![], 251);
let mut tree = MerkleTree::<Pedersen>::new(smallvec![], 5);
for step in &self.0 {
match step {
Step::Insert(k, v) => {
Expand Down
12 changes: 6 additions & 6 deletions src/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn basics() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();
let pair1 = (
vec![1, 2, 1],
Expand Down Expand Up @@ -69,7 +69,7 @@ fn root_hash_similar_rocks_db() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();
let pair1 = (
vec![1, 2, 1],
Expand Down Expand Up @@ -116,7 +116,7 @@ fn root_hash_similar_rocks_db() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();
let pair1 = (
vec![1, 2, 3],
Expand Down Expand Up @@ -237,7 +237,7 @@ fn root_hash_similar_hashmap_db() {
let db = HashMapDb::<BasicId>::default();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(db, config, 251).unwrap();
BonsaiStorage::new(db, config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();
let pair1 = (
vec![1, 2, 1],
Expand Down Expand Up @@ -283,7 +283,7 @@ fn root_hash_similar_hashmap_db() {
let db = HashMapDb::<BasicId>::default();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(db, config, 251).unwrap();
BonsaiStorage::new(db, config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();
let pair1 = (
vec![1, 2, 3],
Expand Down Expand Up @@ -450,7 +450,7 @@ fn get_changes() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();
let pair1 = (vec![1, 2, 1], Felt::from_hex("0x01").unwrap());
let bitvec = BitVec::from_vec(pair1.0.clone());
Expand Down
24 changes: 12 additions & 12 deletions src/tests/transactional_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn basics() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -61,7 +61,7 @@ fn test_thread() {
let mut bonsai_storage = BonsaiStorage::new(
RocksDB::new(&db, RocksDBConfig::default()),
config.clone(),
251,
24,
)
.unwrap();
let mut id_builder = BasicIdBuilder::new();
Expand Down Expand Up @@ -123,7 +123,7 @@ fn remove() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -168,7 +168,7 @@ fn merge() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -211,7 +211,7 @@ fn merge_with_uncommitted_insert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -273,7 +273,7 @@ fn merge_with_uncommitted_remove() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -331,7 +331,7 @@ fn transactional_state_after_uncommitted() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -373,7 +373,7 @@ fn merge_override() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -416,7 +416,7 @@ fn merge_remove() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -455,7 +455,7 @@ fn merge_txn_revert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -515,7 +515,7 @@ fn merge_invalid() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -562,7 +562,7 @@ fn many_snapshots() {
..Default::default()
};
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down
12 changes: 6 additions & 6 deletions src/tests/trie_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn basics() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -62,7 +62,7 @@ fn unrecorded_revert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand All @@ -87,7 +87,7 @@ fn in_place_revert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (vec![1, 2, 3], &BonsaiTrieHash::default());
Expand All @@ -110,7 +110,7 @@ fn truncated_revert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -150,7 +150,7 @@ fn double_revert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down Expand Up @@ -192,7 +192,7 @@ fn remove_and_reinsert() {
let db = create_rocks_db(tempdir.path()).unwrap();
let config = BonsaiStorageConfig::default();
let mut bonsai_storage: BonsaiStorage<_, _, Pedersen> =
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 251).unwrap();
BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config, 24).unwrap();
let mut id_builder = BasicIdBuilder::new();

let pair1 = (
Expand Down

0 comments on commit 956b537

Please sign in to comment.