@@ -34,12 +34,11 @@ pub struct LedgerConfig {
3434 /// The file system path onto which the ledger should be written at
3535 /// If left empty it will be auto-generated to a temporary folder
3636 #[ derive_env_var]
37- #[ clap_from_serde_skip]
3837 #[ arg(
3938 help = "The file system path onto which the ledger should be written at."
4039 ) ]
41- #[ serde( default ) ]
42- pub path : Option < String > ,
40+ #[ serde( default = "default_ledger_path" ) ]
41+ pub path : String ,
4342 /// The size under which it's desired to keep ledger in bytes.
4443 #[ derive_env_var]
4544 #[ arg( help = "The size under which it's desired to keep ledger in bytes." ) ]
@@ -75,7 +74,7 @@ impl Default for LedgerConfig {
7574 Self {
7675 resume_strategy_config : LedgerResumeStrategyConfig :: default ( ) ,
7776 skip_keypair_match_check : false ,
78- path : Default :: default ( ) ,
77+ path : default_ledger_path ( ) ,
7978 size : DEFAULT_LEDGER_SIZE_BYTES ,
8079 }
8180 }
@@ -226,6 +225,10 @@ const fn default_cloning_concurrency() -> usize {
226225 10
227226}
228227
228+ fn default_ledger_path ( ) -> String {
229+ "test-ledger-magicblock" . to_string ( )
230+ }
231+
229232#[ cfg( test) ]
230233mod tests {
231234 use magicblock_config_helpers:: Merge ;
@@ -284,7 +287,7 @@ mod tests {
284287 account_hydration_concurrency : 20 ,
285288 } ,
286289 skip_keypair_match_check : true ,
287- path : Some ( "ledger.example.com" . to_string ( ) ) ,
290+ path : "ledger.example.com" . to_string ( ) ,
288291 size : 1000000000 ,
289292 } ;
290293 let original_config = config. clone ( ) ;
@@ -306,7 +309,7 @@ mod tests {
306309 account_hydration_concurrency : 20 ,
307310 } ,
308311 skip_keypair_match_check : true ,
309- path : Some ( "ledger.example.com" . to_string ( ) ) ,
312+ path : "ledger.example.com" . to_string ( ) ,
310313 size : 1000000000 ,
311314 } ;
312315
@@ -325,7 +328,7 @@ mod tests {
325328 account_hydration_concurrency : 20 ,
326329 } ,
327330 skip_keypair_match_check : true ,
328- path : Some ( "ledger.example.com" . to_string ( ) ) ,
331+ path : "ledger.example.com" . to_string ( ) ,
329332 size : 1000000000 ,
330333 } ;
331334 let original_config = config. clone ( ) ;
@@ -337,7 +340,7 @@ mod tests {
337340 account_hydration_concurrency : 150 ,
338341 } ,
339342 skip_keypair_match_check : true ,
340- path : Some ( "ledger2.example.com" . to_string ( ) ) ,
343+ path : "ledger2.example.com" . to_string ( ) ,
341344 size : 10000 ,
342345 } ;
343346
@@ -368,7 +371,7 @@ size = 1000000000
368371 ) ,
369372 } ,
370373 skip_keypair_match_check: true ,
371- path: Some ( "ledger.example.com" . to_string( ) ) ,
374+ path: "ledger.example.com" . to_string( ) ,
372375 size: 1000000000 ,
373376 }
374377 ) ;
@@ -391,7 +394,7 @@ size = 1000000000
391394 ) ,
392395 } ,
393396 skip_keypair_match_check: false ,
394- path: None ,
397+ path: default_ledger_path ( ) ,
395398 size: 1000000000 ,
396399 }
397400 ) ;
@@ -414,7 +417,7 @@ size = 1000000000
414417 ) ,
415418 } ,
416419 skip_keypair_match_check: false ,
417- path: None ,
420+ path: "test-ledger-magicblock" . to_string ( ) ,
418421 size: 1000000000 ,
419422 }
420423 ) ;
0 commit comments