trie/bintrie: print todot path in binary (#34777)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

The nodes were named using the byte representation of the path, instead
of the binary representation. This was confusing to other client devs
trying to achieve interop.
This commit is contained in:
Guillaume Ballet 2026-04-21 14:50:09 +02:00 committed by GitHub
parent f568ab9931
commit c374e74ee1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -279,10 +279,10 @@ func (s *nodeStore) toDot(ref nodeRef, parent, path string) string {
ret = fmt.Sprintf("%s %s -> %s\n", ret, parent, me)
}
if !node.left.IsEmpty() {
ret += s.toDot(node.left, me, fmt.Sprintf("%s%02x", path, 0))
ret += s.toDot(node.left, me, fmt.Sprintf("%s%b", path, 0))
}
if !node.right.IsEmpty() {
ret += s.toDot(node.right, me, fmt.Sprintf("%s%02x", path, 1))
ret += s.toDot(node.right, me, fmt.Sprintf("%s%b", path, 1))
}
return ret
case kindStem: