Skip to content

Commit e1321c5

Browse files
committed
cmd: fix clang tidy after PR 2056
1 parent 1ec9695 commit e1321c5

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

cmd/dev/snapshots.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include <silkworm/db/snapshots/body_queries.hpp>
3939
#include <silkworm/db/snapshots/header_index.hpp>
4040
#include <silkworm/db/snapshots/header_queries.hpp>
41-
#include <silkworm/db/snapshots/index_builder.hpp>
4241
#include <silkworm/db/snapshots/repository.hpp>
4342
#include <silkworm/db/snapshots/seg/seg_zip.hpp>
4443
#include <silkworm/db/snapshots/snapshot_reader.hpp>
@@ -233,7 +232,7 @@ static std::unique_ptr<SnapshotBundleFactory> bundle_factory() {
233232
}
234233

235234
void count_bodies(const SnapSettings& settings, int repetitions) {
236-
SnapshotRepository snapshot_repo{settings, bundle_factory()};
235+
SnapshotRepository snapshot_repo{SnapshotSettings{settings}, bundle_factory()};
237236
snapshot_repo.reopen_folder();
238237
std::chrono::time_point start{std::chrono::steady_clock::now()};
239238
int num_bodies{0};
@@ -257,7 +256,7 @@ void count_bodies(const SnapSettings& settings, int repetitions) {
257256
}
258257

259258
void count_headers(const SnapSettings& settings, int repetitions) {
260-
SnapshotRepository snapshot_repo{settings, bundle_factory()};
259+
SnapshotRepository snapshot_repo{SnapshotSettings{settings}, bundle_factory()};
261260
snapshot_repo.reopen_folder();
262261
std::chrono::time_point start{std::chrono::steady_clock::now()};
263262
int count{0};
@@ -410,7 +409,7 @@ void lookup_header_by_hash(const SnapSettings& settings) {
410409

411410
std::optional<SnapshotPath> matching_snapshot;
412411
std::optional<BlockHeader> matching_header;
413-
SnapshotRepository snapshot_repository{settings, bundle_factory()};
412+
SnapshotRepository snapshot_repository{SnapshotSettings{settings}, bundle_factory()};
414413
snapshot_repository.reopen_folder();
415414
for (const SnapshotBundle& bundle : snapshot_repository.view_bundles_reverse()) {
416415
auto snapshot_and_index = bundle.snapshot_and_index(SnapshotType::headers);
@@ -439,7 +438,7 @@ void lookup_header_by_number(const SnapSettings& settings) {
439438
SILK_INFO << "Lookup header number: " << block_number;
440439
std::chrono::time_point start{std::chrono::steady_clock::now()};
441440

442-
SnapshotRepository snapshot_repository{settings, bundle_factory()};
441+
SnapshotRepository snapshot_repository{SnapshotSettings{settings}, bundle_factory()};
443442
snapshot_repository.reopen_folder();
444443
const auto snapshot_and_index = snapshot_repository.find_segment(SnapshotType::headers, block_number);
445444
if (snapshot_and_index) {
@@ -499,7 +498,7 @@ void lookup_body_in_one(const SnapSettings& settings, BlockNum block_number, con
499498
}
500499

501500
void lookup_body_in_all(const SnapSettings& settings, BlockNum block_number) {
502-
SnapshotRepository snapshot_repository{settings, bundle_factory()};
501+
SnapshotRepository snapshot_repository{SnapshotSettings{settings}, bundle_factory()};
503502
snapshot_repository.reopen_folder();
504503

505504
std::chrono::time_point start{std::chrono::steady_clock::now()};
@@ -606,7 +605,7 @@ void lookup_txn_by_hash_in_one(const SnapSettings& settings, const Hash& hash, c
606605
}
607606

608607
void lookup_txn_by_hash_in_all(const SnapSettings& settings, const Hash& hash) {
609-
SnapshotRepository snapshot_repository{settings, bundle_factory()};
608+
SnapshotRepository snapshot_repository{SnapshotSettings{settings}, bundle_factory()};
610609
snapshot_repository.reopen_folder();
611610

612611
std::optional<SnapshotPath> matching_snapshot;
@@ -670,7 +669,7 @@ void lookup_txn_by_id_in_one(const SnapSettings& settings, uint64_t txn_id, cons
670669
}
671670

672671
void lookup_txn_by_id_in_all(const SnapSettings& settings, uint64_t txn_id) {
673-
SnapshotRepository snapshot_repository{settings, bundle_factory()};
672+
SnapshotRepository snapshot_repository{SnapshotSettings{settings}, bundle_factory()};
674673
snapshot_repository.reopen_folder();
675674

676675
std::optional<SnapshotPath> matching_snapshot;
@@ -716,7 +715,7 @@ void lookup_transaction(const SnapSettings& settings) {
716715

717716
void sync(const SnapSettings& settings) {
718717
std::chrono::time_point start{std::chrono::steady_clock::now()};
719-
SnapshotRepository snapshot_repository{settings, bundle_factory()};
718+
SnapshotRepository snapshot_repository{SnapshotSettings{settings}, bundle_factory()};
720719
db::SnapshotSync snapshot_sync{&snapshot_repository, kMainnetConfig};
721720
std::vector<std::string> snapshot_file_names;
722721
if (settings.snapshot_file_name) {

0 commit comments

Comments
 (0)