Skip to content

Commit 08cbb3b

Browse files
committed
refactor: remove unused method
1 parent 817a469 commit 08cbb3b

File tree

1 file changed

+0
-67
lines changed

1 file changed

+0
-67
lines changed

crates/storage/src/store.rs

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -181,73 +181,6 @@ impl Store {
181181
Self { backend }
182182
}
183183

184-
/// Creates a new Store with the given initial values.
185-
#[expect(clippy::too_many_arguments)]
186-
pub fn new(
187-
time: u64,
188-
config: ChainConfig,
189-
head: H256,
190-
safe_target: H256,
191-
latest_justified: Checkpoint,
192-
latest_finalized: Checkpoint,
193-
blocks: impl IntoIterator<Item = (H256, Block)>,
194-
states: impl IntoIterator<Item = (H256, State)>,
195-
) -> Self {
196-
let backend: Arc<dyn StorageBackend> = Arc::new(InMemoryBackend::new());
197-
198-
// Insert all data
199-
{
200-
let mut batch = backend.begin_write().expect("write batch");
201-
202-
// Metadata
203-
batch
204-
.put_batch(
205-
Table::Metadata,
206-
vec![
207-
(KEY_TIME.to_vec(), time.as_ssz_bytes()),
208-
(KEY_CONFIG.to_vec(), config.as_ssz_bytes()),
209-
(KEY_HEAD.to_vec(), head.as_ssz_bytes()),
210-
(KEY_SAFE_TARGET.to_vec(), safe_target.as_ssz_bytes()),
211-
(
212-
KEY_LATEST_JUSTIFIED.to_vec(),
213-
latest_justified.as_ssz_bytes(),
214-
),
215-
(
216-
KEY_LATEST_FINALIZED.to_vec(),
217-
latest_finalized.as_ssz_bytes(),
218-
),
219-
],
220-
)
221-
.expect("put metadata");
222-
223-
// Blocks
224-
let block_entries: Vec<_> = blocks
225-
.into_iter()
226-
.map(|(k, v)| (k.as_ssz_bytes(), v.as_ssz_bytes()))
227-
.collect();
228-
if !block_entries.is_empty() {
229-
batch
230-
.put_batch(Table::Blocks, block_entries)
231-
.expect("put blocks");
232-
}
233-
234-
// States
235-
let state_entries: Vec<_> = states
236-
.into_iter()
237-
.map(|(k, v)| (k.as_ssz_bytes(), v.as_ssz_bytes()))
238-
.collect();
239-
if !state_entries.is_empty() {
240-
batch
241-
.put_batch(Table::States, state_entries)
242-
.expect("put states");
243-
}
244-
245-
batch.commit().expect("commit");
246-
}
247-
248-
Self { backend }
249-
}
250-
251184
// ============ Metadata Helpers ============
252185

253186
fn get_metadata<T: Decode>(&self, key: &[u8]) -> T {

0 commit comments

Comments
 (0)