|
2 | 2 |
|
3 | 3 | use alloy_consensus::EMPTY_ROOT_HASH; |
4 | 4 | use alloy_eips::BlockNumberOrTag; |
5 | | -use alloy_node_bindings::utils::run_with_tempdir; |
6 | | -use alloy_primitives::{Address, U256}; |
| 5 | +use alloy_primitives::Address; |
7 | 6 | use alloy_provider::Provider; |
8 | 7 | use anvil::{spawn, EthereumHardfork, NodeConfig}; |
9 | | -use std::time::Duration; |
10 | 8 |
|
11 | 9 | #[tokio::test(flavor = "multi_thread")] |
12 | 10 | async fn test_can_change_mining_mode() { |
@@ -120,33 +118,3 @@ async fn test_cancun_fields() { |
120 | 118 | assert!(block.header.blob_gas_used.is_some()); |
121 | 119 | assert!(block.header.excess_blob_gas.is_some()); |
122 | 120 | } |
123 | | - |
124 | | -#[tokio::test(flavor = "multi_thread")] |
125 | | -#[cfg(not(windows))] |
126 | | -async fn test_cache_path() { |
127 | | - run_with_tempdir("custom-anvil-cache", |tmp_dir| async move { |
128 | | - let cache_path = tmp_dir.join("cache"); |
129 | | - let (api, _handle) = spawn( |
130 | | - NodeConfig::test() |
131 | | - .with_cache_path(Some(cache_path.clone())) |
132 | | - .with_max_persisted_states(Some(5_usize)) |
133 | | - .with_blocktime(Some(Duration::from_millis(1))), |
134 | | - ) |
135 | | - .await; |
136 | | - |
137 | | - api.anvil_mine(Some(U256::from(1000)), None).await.unwrap(); |
138 | | - |
139 | | - // sleep to ensure the cache is written |
140 | | - tokio::time::sleep(Duration::from_secs(2)).await; |
141 | | - |
142 | | - assert!(cache_path.exists()); |
143 | | - assert!(cache_path.read_dir().unwrap().count() > 0); |
144 | | - |
145 | | - // Clean the directory, this is to prevent an error when temp_dir is dropped. |
146 | | - let _ = std::fs::remove_dir_all(cache_path); |
147 | | - |
148 | | - //sleep to ensure OS file handles are released |
149 | | - tokio::time::sleep(Duration::from_secs(1)).await; |
150 | | - }) |
151 | | - .await; |
152 | | -} |
0 commit comments