()
| 896 | |
| 897 | #[test] |
| 898 | fn wrapper_cache_detects_wrappers() { |
| 899 | let cache = WrapperCache::new(100); |
| 900 | let h = |b: u8| AppDataHash([b; 32]); |
| 901 | |
| 902 | assert!(!cache.has_wrappers(&h(1), None)); |
| 903 | assert!(!cache.has_wrappers(&h(2), Some("{}"))); |
| 904 | assert!(!cache.has_wrappers(&h(3), Some(r#"{"metadata": {}}"#))); |
| 905 | assert!(!cache.has_wrappers(&h(4), Some(r#"{"metadata": {"wrappers": []}}"#))); |
| 906 | assert!(cache.has_wrappers( |
| 907 | &h(5), |
| 908 | Some(r#"{"metadata": {"wrappers": [{"address": "0x0000000000000000000000000000000000000001", "data": "0x"}]}}"#), |
| 909 | )); |
| 910 | |
| 911 | // Second call hits the cache |
| 912 | assert!(cache.has_wrappers(&h(5), None)); |
| 913 | } |
| 914 | |
| 915 | #[test] |
| 916 | fn misc() { |
nothing calls this directly
no test coverage detected