-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix printing trie hash #3926
Fix printing trie hash #3926
Conversation
@@ -94,9 +94,9 @@ func (mt *MTrie) RootNode() *node.Node { | |||
// Concurrency safe (as Tries are immutable structures by convention) | |||
func (mt *MTrie) String() string { | |||
if mt.IsEmpty() { | |||
return fmt.Sprintf("Empty Trie with default root hash: %x\n", mt.RootHash()) | |||
return fmt.Sprintf("Empty Trie with default root hash: %v\n", mt.RootHash()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RootHash()
returns hash.Hash
, which has implemented String
method already, using %x
would double encoding.
For instance,
Before the fix, it prints:
Empty Trie with default root hash: 35363866346563373430666533623564653838303334636237623166626464623431353438623036386633316165626338616539313839653432396335373439
After the fix, it prints:
Empty Trie with default root hash: 568f4ec740fe3b5de88034cb7b1fbddb41548b068f31aebc8ae9189e429c5749
Codecov Report
@@ Coverage Diff @@
## master #3926 +/- ##
=======================================
Coverage 53.32% 53.32%
=======================================
Files 819 819
Lines 76764 76764
=======================================
+ Hits 40935 40937 +2
+ Misses 32516 32514 -2
Partials 3313 3313
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
bors merge |
Build failed: |
bors retry |
Build failed:
|
bors retry |
No description provided.