mirror of
https://github.com/arnaucube/go-merkletree-iden3.git
synced 2026-02-07 11:36:47 +01:00
Correction to the GraphViz function when drawing empty nodes
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/iden3/go-iden3-core/common"
|
"github.com/iden3/go-iden3-core/common"
|
||||||
@@ -603,11 +604,15 @@ node [fontname=Monospace,fontsize=10,shape=box]
|
|||||||
for i := range lr {
|
for i := range lr {
|
||||||
if lr[i] == "0" {
|
if lr[i] == "0" {
|
||||||
lr[i] = fmt.Sprintf("empty%v", cnt)
|
lr[i] = fmt.Sprintf("empty%v", cnt)
|
||||||
fmt.Fprintf(w, "\"%v\" [style=dashed,label=0];\n", lr[i])
|
|
||||||
cnt++
|
cnt++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Fprintf(w, "\"%v\" -> {\"%v\" \"%v\"}\n", k.BigInt().String(), lr[0], lr[1])
|
fmt.Fprintf(w, "\"%v\" -> {\"%v\" \"%v\"}\n", k.BigInt().String(), lr[0], lr[1])
|
||||||
|
for i := range lr {
|
||||||
|
if strings.HasPrefix(lr[i], "empty") {
|
||||||
|
fmt.Fprintf(w, "\"%v\" [style=dashed,label=0];\n", lr[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user