aboutsummaryrefslogtreecommitdiff
path: root/pkg/types
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-13 14:28:29 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-13 14:28:29 +0200
commit5632bd67ed38625a8c8c372302aa7b19d163512e (patch)
tree8e70c97e5a961d66881d3c086f7475831de4377b /pkg/types
parent33e199c9939e110bd677e7b3e43547c6e55bb6e2 (diff)
removed redundant output
Diffstat (limited to 'pkg/types')
-rw-r--r--pkg/types/ascii.go9
-rw-r--r--pkg/types/ascii_test.go7
2 files changed, 2 insertions, 14 deletions
diff --git a/pkg/types/ascii.go b/pkg/types/ascii.go
index 7643ab1..f0a96ad 100644
--- a/pkg/types/ascii.go
+++ b/pkg/types/ascii.go
@@ -238,12 +238,6 @@ func (si *SigIdent) MarshalASCII(w io.Writer) error {
}
func (p *ConsistencyProof) MarshalASCII(w io.Writer) error {
- if err := writeASCII(w, NewSize, strconv.FormatUint(p.NewSize, 10)); err != nil {
- return fmt.Errorf("writeASCII: %v", err)
- }
- if err := writeASCII(w, OldSize, strconv.FormatUint(p.OldSize, 10)); err != nil {
- return fmt.Errorf("writeASCII: %v", err)
- }
for _, hash := range p.Path {
if err := writeASCII(w, ConsistencyPath, hex.EncodeToString(hash[:])); err != nil {
return fmt.Errorf("writeASCII: %v", err)
@@ -253,9 +247,6 @@ func (p *ConsistencyProof) MarshalASCII(w io.Writer) error {
}
func (p *InclusionProof) MarshalASCII(w io.Writer) error {
- if err := writeASCII(w, TreeSize, strconv.FormatUint(p.TreeSize, 10)); err != nil {
- return fmt.Errorf("writeASCII: %v", err)
- }
if err := writeASCII(w, LeafIndex, strconv.FormatUint(p.LeafIndex, 10)); err != nil {
return fmt.Errorf("writeASCII: %v", err)
}
diff --git a/pkg/types/ascii_test.go b/pkg/types/ascii_test.go
index 74a1e37..c3f9e98 100644
--- a/pkg/types/ascii_test.go
+++ b/pkg/types/ascii_test.go
@@ -176,8 +176,7 @@ func TestInclusionProofMarshalASCII(t *testing.T) {
},
}
wantBuf := bytes.NewBufferString(fmt.Sprintf(
- "%s%s%d%s"+"%s%s%d%s"+"%s%s%x%s"+"%s%s%x%s",
- TreeSize, Delim, 321, EOL,
+ "%s%s%d%s"+"%s%s%x%s"+"%s%s%x%s",
LeafIndex, Delim, 123, EOL,
InclusionPath, Delim, testBuffer32[:], EOL,
InclusionPath, Delim, testBuffer32[:], EOL,
@@ -203,9 +202,7 @@ func TestConsistencyProofMarshalASCII(t *testing.T) {
},
}
wantBuf := bytes.NewBufferString(fmt.Sprintf(
- "%s%s%d%s"+"%s%s%d%s"+"%s%s%x%s"+"%s%s%x%s",
- NewSize, Delim, 321, EOL,
- OldSize, Delim, 123, EOL,
+ "%s%s%x%s"+"%s%s%x%s",
ConsistencyPath, Delim, testBuffer32[:], EOL,
ConsistencyPath, Delim, testBuffer32[:], EOL,
))