Skip to content

Commit

Permalink
add stem to leaf graphviz output
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet committed Nov 30, 2023
1 parent d193f0b commit 5a8a683
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ func (n *LeafNode) Value(i int) []byte {
func (n *LeafNode) toDot(parent, path string) string {
var hash Fr
n.Commitment().MapToScalarField(&hash)
ret := fmt.Sprintf("leaf%s [label=\"L: %x\nC: %x\nC₁: %x\nC₂:%x\"]\n%s -> leaf%s\n", path, hash.Bytes(), n.commitment.Bytes(), n.c1.Bytes(), n.c2.Bytes(), parent, path)
ret := fmt.Sprintf("leaf%s [label=\"L: %x\nC: %x\nStem: %x\nC₁: %x\nC₂:%x\"]\n%s -> leaf%s\n", path, hash.Bytes(), n.commitment.Bytes(), n.stem, n.c1.Bytes(), n.c2.Bytes(), parent, path)
for i, v := range n.values {
if len(v) != 0 {
ret = fmt.Sprintf("%sval%s%02x [label=\"%x\"]\nleaf%s -> val%s%02x\n", ret, path, i, v, path, path, i)
Expand Down

0 comments on commit 5a8a683

Please sign in to comment.