@@ -81,13 +81,13 @@ fn full_key_lifecycle_single_key() {
8181 assert_eq ! ( retrieved, key_material, "Retrieved content must match original" ) ;
8282
8383 // Step 5: Verify attestation references the key
84- let attest_read = fs:: read_to_string ( base. join ( ".jk/attestation/0001.json" ) )
84+ let attest_read = ( { use std :: io :: Read ; std :: fs:: File :: open ( base. join ( ".jk/attestation/0001.json" ) . and_then ( | mut f| { let mut buf = String :: new ( ) ; f . take ( 10 * 1024 * 1024 ) . read_to_string ( & mut buf ) ? ; Ok ( buf ) } ) } ) )
8585 . expect ( "Read attestation" ) ;
8686 assert ! ( attest_read. contains( key_id) , "Attestation must contain key ID" ) ;
8787 assert ! ( attest_read. contains( & key_hash) , "Attestation must contain content hash" ) ;
8888
8989 // Verify key record exists
90- let key_read = fs:: read_to_string ( base. join ( ".jk/keys/001.json" ) )
90+ let key_read = ( { use std :: io :: Read ; std :: fs:: File :: open ( base. join ( ".jk/keys/001.json" ) . and_then ( | mut f| { let mut buf = String :: new ( ) ; f . take ( 10 * 1024 * 1024 ) . read_to_string ( & mut buf ) ? ; Ok ( buf ) } ) } ) )
9191 . expect ( "Read key record" ) ;
9292 assert ! ( key_read. contains( key_id) , "Key record must contain ID" ) ;
9393}
@@ -167,7 +167,7 @@ fn full_key_lifecycle_multi_key_transaction() {
167167
168168 // Verify transaction is committed
169169 let tx_read =
170- fs:: read_to_string ( base. join ( ".jk/transactions/001.json" ) ) . expect ( "Read tx" ) ;
170+ ( { use std :: io :: Read ; std :: fs:: File :: open ( base. join ( ".jk/transactions/001.json" ) . and_then ( | mut f| { let mut buf = String :: new ( ) ; f . take ( 10 * 1024 * 1024 ) . read_to_string ( & mut buf ) ? ; Ok ( buf ) } ) } ) ) . expect ( "Read tx" ) ;
171171 assert ! ( tx_read. contains( "committed" ) , "Transaction must be committed" ) ;
172172}
173173
@@ -359,7 +359,7 @@ fn corrupted_attestation_entry_detected() {
359359 . expect ( "Write malformed entry" ) ;
360360
361361 // Attempt to read and parse
362- let read_result = fs:: read_to_string ( base. join ( ".jk/attestation/0001.json" ) )
362+ let read_result = ( { use std :: io :: Read ; std :: fs:: File :: open ( base. join ( ".jk/attestation/0001.json" ) . and_then ( | mut f| { let mut buf = String :: new ( ) ; f . take ( 10 * 1024 * 1024 ) . read_to_string ( & mut buf ) ? ; Ok ( buf ) } ) } ) )
363363 . expect ( "Read file" ) ;
364364 let parse_result = serde_json:: from_str :: < serde_json:: Value > ( & read_result) ;
365365
0 commit comments