Creates a new [`ExecutorTestFixtureCreator`] with the given parameters.
(provider_url: &str, block_number: u64, base_fixture_directory: PathBuf)
| 90 | impl ExecutorTestFixtureCreator { |
| 91 | /// Creates a new [`ExecutorTestFixtureCreator`] with the given parameters. |
| 92 | pub fn new(provider_url: &str, block_number: u64, base_fixture_directory: PathBuf) -> Self { |
| 93 | let base = base_fixture_directory.join(format!("block-{block_number}")); |
| 94 | |
| 95 | let url = provider_url.parse().expect("Invalid provider URL"); |
| 96 | let http = Http::<Client>::new(url); |
| 97 | let provider = RootProvider::new(RpcClient::new(http, false)); |
| 98 | |
| 99 | let mut options = Options::default(); |
| 100 | options.set_compression_type(rocksdb::DBCompressionType::Snappy); |
| 101 | options.create_if_missing(true); |
| 102 | let db = DB::open(&options, base.join("kv").as_path()) |
| 103 | .unwrap_or_else(|e| panic!("Failed to open database at {base:?}: {e}")); |
| 104 | |
| 105 | Self { provider, block_number, kv_store: Arc::new(Mutex::new(db)), data_dir: base } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | impl ExecutorTestFixtureCreator { |