chore(db): remove block numhash key (#1242)

This commit is contained in:
Roman Krasiuk
2023-02-10 23:43:00 +02:00
committed by GitHub
parent 23848df73a
commit 00a49f5ee7
20 changed files with 175 additions and 271 deletions

View File

@@ -177,16 +177,16 @@ mod tests {
let env = test_utils::create_test_db::<NoWriteMap>(EnvKind::RW);
let value = Header::default();
let key = (1u64, H256::zero());
let key = 1u64;
// PUT
let tx = env.tx_mut().expect(ERROR_INIT_TX);
tx.put::<Headers>(key.into(), value.clone()).expect(ERROR_PUT);
tx.put::<Headers>(key, value.clone()).expect(ERROR_PUT);
tx.commit().expect(ERROR_COMMIT);
// GET
let tx = env.tx().expect(ERROR_INIT_TX);
let result = tx.get::<Headers>(key.into()).expect(ERROR_GET);
let result = tx.get::<Headers>(key).expect(ERROR_GET);
assert!(result.expect(ERROR_RETURN_VALUE) == value);
tx.commit().expect(ERROR_COMMIT);
}
@@ -196,11 +196,11 @@ mod tests {
let env = test_utils::create_test_db::<NoWriteMap>(EnvKind::RW);
let value = Header::default();
let key = (1u64, H256::zero());
let key = 1u64;
// PUT
let tx = env.tx_mut().expect(ERROR_INIT_TX);
tx.put::<Headers>(key.into(), value.clone()).expect(ERROR_PUT);
tx.put::<Headers>(key, value.clone()).expect(ERROR_PUT);
tx.commit().expect(ERROR_COMMIT);
// Cursor
@@ -211,7 +211,7 @@ mod tests {
assert!(first.is_some(), "First should be our put");
// Walk
let walk = cursor.walk(key.into()).unwrap();
let walk = cursor.walk(key).unwrap();
let first = walk.into_iter().next().unwrap().unwrap();
assert_eq!(first.1, value, "First next should be put value");
}