@@ -363,6 +363,8 @@ mod tests {
363363 use crate :: keri:: Prefix ;
364364 use tempfile:: TempDir ;
365365
366+ const VALID_OID : & str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ;
367+
366368 fn create_test_state ( ) -> KeyState {
367369 KeyState :: from_inception (
368370 Prefix :: new_unchecked ( "ETestPrefix" . to_string ( ) ) ,
@@ -400,15 +402,7 @@ mod tests {
400402 let tip_said = "ELatestSaid" ;
401403
402404 // Write cache
403- write_kel_cache (
404- dir. path ( ) ,
405- did,
406- & state,
407- tip_said,
408- "abc123def456" ,
409- Utc :: now ( ) ,
410- )
411- . unwrap ( ) ;
405+ write_kel_cache ( dir. path ( ) , did, & state, tip_said, VALID_OID , Utc :: now ( ) ) . unwrap ( ) ;
412406
413407 // Read it back
414408 let loaded = try_load_cached_state ( dir. path ( ) , did, tip_said) ;
@@ -425,7 +419,7 @@ mod tests {
425419 let state = create_test_state ( ) ;
426420
427421 // Write cache with one SAID
428- write_kel_cache ( dir. path ( ) , did, & state, "EOldSaid" , "commit123" , Utc :: now ( ) ) . unwrap ( ) ;
422+ write_kel_cache ( dir. path ( ) , did, & state, "EOldSaid" , VALID_OID , Utc :: now ( ) ) . unwrap ( ) ;
429423
430424 // Try to load with different SAID - should return None
431425 let result = try_load_cached_state ( dir. path ( ) , did, "ENewSaid" ) ;
@@ -444,15 +438,7 @@ mod tests {
444438 let tip_said = "ESaid" ;
445439
446440 // Write cache
447- write_kel_cache (
448- dir. path ( ) ,
449- did,
450- & state,
451- tip_said,
452- "abc123def456" ,
453- Utc :: now ( ) ,
454- )
455- . unwrap ( ) ;
441+ write_kel_cache ( dir. path ( ) , did, & state, tip_said, VALID_OID , Utc :: now ( ) ) . unwrap ( ) ;
456442
457443 // Manually corrupt the cache by writing wrong DID
458444 let path = cache_path_for_did ( dir. path ( ) , did) ;
@@ -496,15 +482,7 @@ mod tests {
496482 let tip_said = "ESaid" ;
497483
498484 // Write cache
499- write_kel_cache (
500- dir. path ( ) ,
501- did,
502- & state,
503- tip_said,
504- "abc123def456" ,
505- Utc :: now ( ) ,
506- )
507- . unwrap ( ) ;
485+ write_kel_cache ( dir. path ( ) , did, & state, tip_said, VALID_OID , Utc :: now ( ) ) . unwrap ( ) ;
508486
509487 // Manually change version
510488 let path = cache_path_for_did ( dir. path ( ) , did) ;
@@ -525,7 +503,7 @@ mod tests {
525503 let state = create_test_state ( ) ;
526504
527505 // Write and verify cache exists
528- write_kel_cache ( dir. path ( ) , did, & state, "ESaid" , "commit123" , Utc :: now ( ) ) . unwrap ( ) ;
506+ write_kel_cache ( dir. path ( ) , did, & state, "ESaid" , VALID_OID , Utc :: now ( ) ) . unwrap ( ) ;
529507 assert ! ( try_load_cached_state( dir. path( ) , did, "ESaid" ) . is_some( ) ) ;
530508
531509 // Invalidate
@@ -554,7 +532,7 @@ mod tests {
554532 "did:keri:ETest1" ,
555533 & state,
556534 "ESaid1" ,
557- "commit1" ,
535+ VALID_OID ,
558536 Utc :: now ( ) ,
559537 )
560538 . unwrap ( ) ;
@@ -563,7 +541,7 @@ mod tests {
563541 "did:keri:ETest2" ,
564542 & state,
565543 "ESaid2" ,
566- "commit2" ,
544+ VALID_OID ,
567545 Utc :: now ( ) ,
568546 )
569547 . unwrap ( ) ;
@@ -587,7 +565,7 @@ mod tests {
587565 "did:keri:EClear1" ,
588566 & state,
589567 "ESaid" ,
590- "commit1" ,
568+ VALID_OID ,
591569 Utc :: now ( ) ,
592570 )
593571 . unwrap ( ) ;
@@ -596,7 +574,7 @@ mod tests {
596574 "did:keri:EClear2" ,
597575 & state,
598576 "ESaid" ,
599- "commit2" ,
577+ VALID_OID ,
600578 Utc :: now ( ) ,
601579 )
602580 . unwrap ( ) ;
@@ -617,15 +595,7 @@ mod tests {
617595 let state = create_test_state ( ) ;
618596 let tip_said = "ESaid" ;
619597
620- write_kel_cache (
621- dir. path ( ) ,
622- did,
623- & state,
624- tip_said,
625- "abc123def456" ,
626- Utc :: now ( ) ,
627- )
628- . unwrap ( ) ;
598+ write_kel_cache ( dir. path ( ) , did, & state, tip_said, VALID_OID , Utc :: now ( ) ) . unwrap ( ) ;
629599
630600 let inspected = inspect_cache ( dir. path ( ) , did) . unwrap ( ) ;
631601 assert ! ( inspected. is_some( ) ) ;
0 commit comments