Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 913b298

Browse files
committed
remove debug output, some minor cleanup
1 parent d550d59 commit 913b298

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

core/monitor/verify.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232

3333
"github.com/google/keytransparency/core/mutator/entry"
3434
ktpb "github.com/google/keytransparency/core/proto/keytransparency_v1_types"
35-
"fmt"
3635
)
3736

3837
var (
@@ -110,7 +109,6 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error
110109
// from if the checks succeeded or not.
111110
var oldRoot []byte
112111
if m.store.LatestEpoch() > 0 {
113-
fmt.Println("Called")
114112
// retrieve the old root hash from storage!
115113
monRes, err := m.store.Get(in.Epoch - 1)
116114
if err != nil {
@@ -149,9 +147,6 @@ func (m *Monitor) verifyMutations(muts []*ktpb.Mutation, oldRoot, expectedNewRoo
149147
}
150148

151149
// compute the new leaf
152-
fmt.Println("old leaf: ")
153-
fmt.Println(mut.GetProof().GetLeaf().GetLeafValue())
154-
fmt.Println(oldLeaf)
155150
newLeaf, err := mutator.Mutate(oldLeaf, mut.GetUpdate())
156151
if err != nil {
157152
glog.Infof("Mutation did not verify: %v", err)
@@ -183,9 +178,6 @@ func (m *Monitor) verifyMutations(muts []*ktpb.Mutation, oldRoot, expectedNewRoo
183178
}
184179
}
185180
}
186-
fmt.Println(newLeaves)
187-
fmt.Println(expectedNewRoot)
188-
fmt.Println(oldProofNodes)
189181
if err := m.validateMapRoot(expectedNewRoot, mapID, newLeaves, oldProofNodes); err != nil {
190182
errList = append(errList, err)
191183
}

integration/monitor_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,13 @@ amFdON6OhjYnBmJWe4fVnbxny0PfpkvXtg==
4141
-----END EC PRIVATE KEY-----`
4242
)
4343

44-
func TestMonitorEmptyStart(t *testing.T) {
44+
func TestMonitor(t *testing.T) {
4545
bctx := context.Background()
4646
env := NewEnv(t)
4747
defer env.Close(t)
4848
env.Client.RetryCount = 0
4949

5050
// setup monitor:
51-
52-
// TODO(ismail) setup a proper log environment in the integration
53-
// environment, then use GetDomainInfo here:
5451
c := spb.NewKeyTransparencyServiceClient(env.Conn)
5552
resp, err := c.GetDomainInfo(bctx, &kpb.GetDomainInfoRequest{})
5653
if err != nil {
@@ -63,6 +60,7 @@ func TestMonitorEmptyStart(t *testing.T) {
6360
//logTree := resp.Log
6461
mapTree := resp.Map
6562
store := storage.New()
63+
// TODO(ismail): setup and use a real logVerifier instead:
6664
mon, err := monitor.New(fake.NewFakeTrillianLogVerifier(), mapTree, crypto.NewSHA256Signer(signer), store)
6765
if err != nil {
6866
t.Fatalf("Couldn't create monitor: %v", err)

0 commit comments

Comments
 (0)