()
| 867 | |
| 868 | #[test] |
| 869 | fn wrapper_cache_detects_wrappers() { |
| 870 | let cache = WrapperCache::new(100); |
| 871 | let h = |b: u8| AppDataHash([b; 32]); |
| 872 | |
| 873 | assert!(!cache.has_wrappers(&h(1), None)); |
| 874 | assert!(!cache.has_wrappers(&h(2), Some("{}"))); |
| 875 | assert!(!cache.has_wrappers(&h(3), Some(r#"{"metadata": {}}"#))); |
| 876 | assert!(!cache.has_wrappers(&h(4), Some(r#"{"metadata": {"wrappers": []}}"#))); |
| 877 | assert!(cache.has_wrappers( |
| 878 | &h(5), |
| 879 | Some(r#"{"metadata": {"wrappers": [{"address": "0x0000000000000000000000000000000000000001", "data": "0x"}]}}"#), |
| 880 | )); |
| 881 | |
| 882 | // Second call hits the cache |
| 883 | assert!(cache.has_wrappers(&h(5), None)); |
| 884 | } |
| 885 | |
| 886 | #[test] |
| 887 | fn misc() { |
nothing calls this directly
no test coverage detected