Relax PartialEq constraint on error enums (#1179)

This commit is contained in:
Adam Szkoda
2020-05-21 02:21:44 +02:00
committed by GitHub
parent 681e013d31
commit d79e07902e
12 changed files with 251 additions and 187 deletions

View File

@@ -3,7 +3,7 @@ use crate::hot_cold_store::HotColdDBError;
use ssz::DecodeError;
use types::{BeaconStateError, Hash256};
#[derive(Debug, PartialEq)]
#[derive(Debug)]
pub enum Error {
SszDecodeError(DecodeError),
VectorChunkError(ChunkError),

View File

@@ -337,20 +337,20 @@ mod tests {
let key = Hash256::random();
let item = StorableThing { a: 1, b: 42 };
assert_eq!(store.exists::<StorableThing>(&key), Ok(false));
assert_eq!(store.exists::<StorableThing>(&key).unwrap(), false);
store.put(&key, &item).unwrap();
assert_eq!(store.exists::<StorableThing>(&key), Ok(true));
assert_eq!(store.exists::<StorableThing>(&key).unwrap(), true);
let retrieved = store.get(&key).unwrap().unwrap();
assert_eq!(item, retrieved);
store.delete::<StorableThing>(&key).unwrap();
assert_eq!(store.exists::<StorableThing>(&key), Ok(false));
assert_eq!(store.exists::<StorableThing>(&key).unwrap(), false);
assert_eq!(store.get::<StorableThing>(&key), Ok(None));
assert_eq!(store.get::<StorableThing>(&key).unwrap(), None);
}
#[test]