Skip to content

Commit

Permalink
Fix hex trace output (#153)
Browse files Browse the repository at this point in the history
* Fix hex trace output

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use ToHex

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored Feb 23, 2022
1 parent 57e3f11 commit 2e1541e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trie-db/src/triedbmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) =
Expand All @@ -1767,7 +1767,7 @@ where

fn remove(&mut self, key: &[u8]) -> Result<Option<Value<L>>, TrieHash<L>, CError<L>> {
#[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);
Expand Down

0 comments on commit 2e1541e

Please sign in to comment.