diff --git a/sdk/examples/client/offline_signing/0_address_generation.rs b/sdk/examples/client/offline_signing/0_address_generation.rs index a34e827889..1262e95a12 100644 --- a/sdk/examples/client/offline_signing/0_address_generation.rs +++ b/sdk/examples/client/offline_signing/0_address_generation.rs @@ -46,6 +46,7 @@ async fn write_address_to_file(path: impl AsRef, address: &[Bec println!("{json}"); file.write_all(json.as_bytes()).await.expect("failed to write to file"); + file.flush().await.expect("failed to flush output stream"); Ok(()) } diff --git a/sdk/examples/client/offline_signing/1_transaction_preparation.rs b/sdk/examples/client/offline_signing/1_transaction_preparation.rs index e4f7467eb0..81b9cedf55 100644 --- a/sdk/examples/client/offline_signing/1_transaction_preparation.rs +++ b/sdk/examples/client/offline_signing/1_transaction_preparation.rs @@ -89,6 +89,7 @@ async fn write_prepared_transaction_to_file( println!("{json}"); file.write_all(json.as_bytes()).await.expect("failed to write file"); + file.flush().await.expect("failed to flush output stream"); Ok(()) } diff --git a/sdk/examples/client/offline_signing/2_transaction_signing.rs b/sdk/examples/client/offline_signing/2_transaction_signing.rs index 5222c52542..74519986dd 100644 --- a/sdk/examples/client/offline_signing/2_transaction_signing.rs +++ b/sdk/examples/client/offline_signing/2_transaction_signing.rs @@ -72,6 +72,7 @@ async fn write_signed_transaction_to_file( let mut file = tokio::io::BufWriter::new(tokio::fs::File::create(path).await.expect("failed to create file")); println!("{json}"); file.write_all(json.as_bytes()).await.expect("failed to write file"); + file.flush().await.expect("failed to flush output stream"); Ok(()) }