fix: tests

This commit is contained in:
ardocrat
2026-06-01 19:36:38 +03:00
parent ebcf7feb28
commit 650df0f3b7
10 changed files with 21 additions and 10 deletions
+1
View File
@@ -42,6 +42,7 @@ pub fn init_chain(dir_name: &str, genesis: Block) -> Chain {
genesis,
pow::verify_size,
false,
None,
)
.unwrap()
}
+2
View File
@@ -67,6 +67,7 @@ fn setup_with_status_adapter(dir_name: &str, genesis: Block, adapter: Arc<Status
genesis,
pow::verify_size,
false,
None,
)
.unwrap();
@@ -1057,6 +1058,7 @@ fn actual_diff_iter_output() {
genesis_block,
pow::verify_size,
false,
None,
)
.unwrap();
let iter = chain.difficulty_iter().unwrap();
+5 -5
View File
@@ -38,7 +38,7 @@ fn test_store_kernel_idx() {
let commit = Commitment::from_vec(vec![]);
let store = ChainStore::new(chain_dir).unwrap();
let store = ChainStore::new(chain_dir, None).unwrap();
let mut batch = store.batch().unwrap();
let index = store::nrd_recent_kernel_index();
@@ -185,7 +185,7 @@ fn test_store_kernel_idx_pop_back() {
let commit = Commitment::from_vec(vec![]);
let store = ChainStore::new(chain_dir).unwrap();
let store = ChainStore::new(chain_dir, None).unwrap();
let mut batch = store.batch().unwrap();
let index = store::nrd_recent_kernel_index();
@@ -293,7 +293,7 @@ fn test_store_kernel_idx_rewind() {
let commit = Commitment::from_vec(vec![]);
let store = ChainStore::new(chain_dir).unwrap();
let store = ChainStore::new(chain_dir, None).unwrap();
let mut batch = store.batch().unwrap();
let index = store::nrd_recent_kernel_index();
@@ -395,7 +395,7 @@ fn test_store_kernel_idx_multiple_commits() {
let commit = Commitment::from_vec(vec![]);
let commit2 = Commitment::from_vec(vec![1]);
let store = ChainStore::new(chain_dir).unwrap();
let store = ChainStore::new(chain_dir, None).unwrap();
let mut batch = store.batch().unwrap();
let index = store::nrd_recent_kernel_index();
@@ -483,7 +483,7 @@ fn test_store_kernel_idx_clear() -> Result<(), Error> {
let commit = Commitment::from_vec(vec![]);
let commit2 = Commitment::from_vec(vec![1]);
let store = ChainStore::new(chain_dir)?;
let store = ChainStore::new(chain_dir, None)?;
let index = store::nrd_recent_kernel_index();
// Add a couple of single entries to the index and commit the batch.
+1
View File
@@ -47,6 +47,7 @@ fn test_coinbase_maturity() {
genesis_block,
pow::verify_size,
false,
None,
)
.unwrap();
+2
View File
@@ -50,6 +50,7 @@ fn test_header_perf_impl(is_test_chain: bool, src_root_dir: &str, dest_root_dir:
genesis.clone(),
pow::verify_size,
false,
None,
)
.unwrap(),
);
@@ -62,6 +63,7 @@ fn test_header_perf_impl(is_test_chain: bool, src_root_dir: &str, dest_root_dir:
genesis.clone(),
pow::verify_size,
false,
None,
)
.unwrap(),
);
+2
View File
@@ -74,6 +74,7 @@ impl SegmenterResponder {
genesis,
pow::verify_size,
false,
None,
)
.unwrap(),
),
@@ -134,6 +135,7 @@ impl DesegmenterRequestor {
genesis,
pow::verify_size,
false,
None,
)
.unwrap(),
),
+1
View File
@@ -52,6 +52,7 @@ fn test_pibd_chain_validation_impl(is_test_chain: bool, src_root_dir: &str) {
genesis.clone(),
pow::verify_size,
false,
None,
)
.unwrap(),
);
+1 -1
View File
@@ -38,7 +38,7 @@ fn test_unexpected_zip() {
let db_root = format!(".grin_txhashset_zip");
clean_output_dir(&db_root);
{
let chain_store = ChainStore::new(&db_root).unwrap();
let chain_store = ChainStore::new(&db_root, None).unwrap();
let store = Arc::new(chain_store);
txhashset::TxHashSet::open(db_root.clone(), store.clone(), None).unwrap();
let head = BlockHeader::default();
+1
View File
@@ -55,6 +55,7 @@ pub fn init_chain(dir_name: &str, genesis: Block) -> Chain {
genesis,
pow::verify_size,
false,
None,
)
.unwrap()
}
+5 -4
View File
@@ -79,7 +79,7 @@ fn test_exists() -> Result<(), store::Error> {
setup(test_dir);
let prefix = b'P';
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None)?;
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None, None)?;
let key = [0, 0, 0, 1];
let value = [1, 1, 1, 1];
@@ -109,7 +109,7 @@ fn test_iter() -> Result<(), store::Error> {
setup(test_dir);
let prefix = b'P';
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None)?;
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None, None)?;
let key = [0, 0, 0, 1];
let value = [1, 1, 1, 1];
@@ -148,7 +148,7 @@ fn lmdb_allocate() -> Result<(), store::Error> {
// Allocate more than the initial chunk, ensuring
// the DB resizes underneath
{
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None)?;
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None, None)?;
for i in 0..WRITE_CHUNK_SIZE * 2 {
println!("Allocating chunk: {}", i);
@@ -164,7 +164,7 @@ fn lmdb_allocate() -> Result<(), store::Error> {
println!("***********************************");
// Open env again and keep adding
{
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None)?;
let store = store::Store::new(test_dir, Some("test1"), None, vec![prefix], None, None)?;
for i in 0..WRITE_CHUNK_SIZE * 2 {
println!("Allocating chunk: {}", i);
let chunk = PhatChunkStruct::new();
@@ -253,6 +253,7 @@ fn test_migration() -> Result<(), store::Error> {
Some(DEFAULT_ENV_NAME),
vec![test_prefix_1, test_prefix_2],
None,
None,
)?;
// Check we can see key value.