MCPcopy Create free account
hub / github.com/base/base / new

Method new

crates/proof/executor/src/test_utils.rs:92–106  ·  view source on GitHub ↗

Creates a new [`ExecutorTestFixtureCreator`] with the given parameters.

(provider_url: &str, block_number: u64, base_fixture_directory: PathBuf)

Source from the content-addressed store, hash-verified

90impl 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
109impl ExecutorTestFixtureCreator {

Callers

nothing calls this directly

Calls 2

newFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected