From c32970f9fbc89ff52e24c263cc8dc170799c0f42 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Wed, 19 Oct 2022 13:05:28 +0200 Subject: [PATCH] better output format --- executor/src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/executor/src/main.rs b/executor/src/main.rs index a204af5a..5310c842 100644 --- a/executor/src/main.rs +++ b/executor/src/main.rs @@ -98,13 +98,14 @@ async fn main() -> Result<(), jsonrpsee::core::Error> { println!("Done"); - for (key, value) in storage_top_trie_changes.into_iter() { - println!( - "Storage changes: {} => {}", - hex::encode(key), - value.map_or("Deleted".to_owned(), hex::encode) - ); - } + let storage_changes = storage_top_trie_changes.into_iter() + .map(|(key, value)| ( + format!("0x{}", hex::encode(key)), + value.map(|x| format!("0x{}", hex::encode(x))).unwrap_or("null".to_owned()) + )) + .collect::>(); + + println!("Storage changes: {:#?}", storage_changes); Ok(()) }