Skip to content

Commit b993cdb

Browse files
author
Clément Turmel
committed
refactor(client-cli): rename download directory
1 parent 683b515 commit b993cdb

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

.github/workflows/test-client.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ jobs:
265265
if: steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true' || steps.aggregator_capability_windows.outputs.cardano_database_v2_enabled == 'true'
266266
shell: bash
267267
working-directory: ./bin
268-
run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} --origin-tag CI cardano-db verify --backend v2 --db-dir db_v2 $CARDANO_DATABASE_V2_SNAPSHOT_HASH | tee cdb-v2-verify-output.txt
268+
run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} --origin-tag CI cardano-db verify --backend v2 --db-dir db $CARDANO_DATABASE_V2_SNAPSHOT_HASH | tee cdb-v2-verify-output.txt
269269

270270
- name: Cardano Database V2 Snapshot / verify Cardano node starts successfully
271271
if: runner.os == 'Linux' && steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true'
@@ -406,7 +406,7 @@ jobs:
406406
- name: Cardano Database V2 Snapshot / verify immutables
407407
if: steps.aggregator_capability.outputs.cardano_database_v2_enabled == 'true'
408408
shell: bash
409-
run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} --origin-tag CI cardano-db verify --backend v2 $CARDANO_DATABASE_V2_SNAPSHOT_HASH --db-dir /app/data/db_v2
409+
run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} --origin-tag CI cardano-db verify --backend v2 $CARDANO_DATABASE_V2_SNAPSHOT_HASH --db-dir /app/data/db
410410

411411
test-mithril-client-wasm:
412412
strategy:

mithril-client-cli/src/commands/cardano_db/download/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ use crate::{
1616
};
1717
use mithril_client::{common::ImmutableFileNumber, MithrilResult};
1818

19+
const DB_DIRECTORY_NAME: &str = "db";
20+
1921
/// Clap command to download a Cardano db and verify its associated certificate.
2022
#[derive(Parser, Debug, Clone)]
2123
pub struct CardanoDbDownloadCommand {

mithril-client-cli/src/commands/cardano_db/download/v1.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use mithril_client::{
88
};
99

1010
use crate::{
11-
commands::{cardano_db::shared_steps, client_builder, SharedArgs},
11+
commands::{
12+
cardano_db::{download::DB_DIRECTORY_NAME, shared_steps},
13+
client_builder, SharedArgs,
14+
},
1215
configuration::ConfigParameters,
1316
utils::{
1417
CardanoDbDownloadChecker, CardanoDbUtils, ExpanderUtils, IndicatifFeedbackReceiver,
@@ -32,7 +35,7 @@ impl PreparedCardanoDbV1Download {
3235

3336
/// Command execution
3437
pub async fn execute(&self, logger: &Logger, params: ConfigParameters) -> MithrilResult<()> {
35-
let db_dir = Path::new(&self.download_dir).join("db");
38+
let db_dir = Path::new(&self.download_dir).join(DB_DIRECTORY_NAME);
3639

3740
let progress_output_type = if self.is_json_output_enabled() {
3841
ProgressOutputType::JsonReporter

mithril-client-cli/src/commands/cardano_db/download/v2.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ use mithril_client::{
1313
};
1414

1515
use crate::{
16-
commands::{cardano_db::shared_steps, client_builder, SharedArgs},
16+
commands::{
17+
cardano_db::{download::DB_DIRECTORY_NAME, shared_steps},
18+
client_builder, SharedArgs,
19+
},
1720
configuration::ConfigParameters,
1821
utils::{
1922
CardanoDbDownloadChecker, CardanoDbUtils, ExpanderUtils, IndicatifFeedbackReceiver,
@@ -45,7 +48,7 @@ pub(super) struct PreparedCardanoDbV2Download {
4548
impl PreparedCardanoDbV2Download {
4649
pub async fn execute(&self, logger: &Logger, params: ConfigParameters) -> MithrilResult<()> {
4750
let restoration_options = RestorationOptions {
48-
db_dir: Path::new(&self.download_dir).join("db_v2"),
51+
db_dir: Path::new(&self.download_dir).join(DB_DIRECTORY_NAME),
4952
immutable_file_range: shared_steps::immutable_file_range(self.start, self.end),
5053
download_unpack_options: DownloadUnpackOptions {
5154
allow_override: self.allow_override,

0 commit comments

Comments
 (0)