From 2e1541e44989f24cec5dbe3081c7cecf00d8b509 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Wed, 23 Feb 2022 13:32:02 +0100 Subject: [PATCH] Fix hex trace output (#153) * Fix hex trace output Signed-off-by: Oliver Tale-Yazdi * Use ToHex Signed-off-by: Oliver Tale-Yazdi --- trie-db/src/triedbmut.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trie-db/src/triedbmut.rs b/trie-db/src/triedbmut.rs index 5430b9db..09890cb3 100644 --- a/trie-db/src/triedbmut.rs +++ b/trie-db/src/triedbmut.rs @@ -1635,7 +1635,7 @@ where } }); #[cfg(feature = "std")] - trace!(target: "trie", "encoded root node: {:#x?}", &encoded_root[..]); + trace!(target: "trie", "encoded root node: {:?}", ToHex(&encoded_root[..])); *self.root = self.db.insert(EMPTY_PREFIX, &encoded_root[..]); self.hash_count += 1; @@ -1752,7 +1752,7 @@ where let mut old_val = None; #[cfg(feature = "std")] - trace!(target: "trie", "insert: key={:#x?}, value={:?}", key, ToHex(&value)); + trace!(target: "trie", "insert: key={:?}, value={:?}", ToHex(key), ToHex(&value)); let root_handle = self.root_handle(); let (new_handle, _changed) = @@ -1767,7 +1767,7 @@ where fn remove(&mut self, key: &[u8]) -> Result>, TrieHash, CError> { #[cfg(feature = "std")] - trace!(target: "trie", "remove: key={:#x?}", key); + trace!(target: "trie", "remove: key={:?}", ToHex(key)); let root_handle = self.root_handle(); let mut key_slice = NibbleSlice::new(key);