From 913b298c0b99eb33cff4b9f6ee57382f5912f79b Mon Sep 17 00:00:00 2001 From: Liamsi Date: Fri, 25 Aug 2017 11:28:23 -0400 Subject: [PATCH] remove debug output, some minor cleanup --- core/monitor/verify.go | 8 -------- integration/monitor_test.go | 6 ++---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/core/monitor/verify.go b/core/monitor/verify.go index dc39c4342..e477786cd 100644 --- a/core/monitor/verify.go +++ b/core/monitor/verify.go @@ -32,7 +32,6 @@ import ( "github.com/google/keytransparency/core/mutator/entry" ktpb "github.com/google/keytransparency/core/proto/keytransparency_v1_types" - "fmt" ) var ( @@ -110,7 +109,6 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error // from if the checks succeeded or not. var oldRoot []byte if m.store.LatestEpoch() > 0 { - fmt.Println("Called") // retrieve the old root hash from storage! monRes, err := m.store.Get(in.Epoch - 1) if err != nil { @@ -149,9 +147,6 @@ func (m *Monitor) verifyMutations(muts []*ktpb.Mutation, oldRoot, expectedNewRoo } // compute the new leaf - fmt.Println("old leaf: ") - fmt.Println(mut.GetProof().GetLeaf().GetLeafValue()) - fmt.Println(oldLeaf) newLeaf, err := mutator.Mutate(oldLeaf, mut.GetUpdate()) if err != nil { glog.Infof("Mutation did not verify: %v", err) @@ -183,9 +178,6 @@ func (m *Monitor) verifyMutations(muts []*ktpb.Mutation, oldRoot, expectedNewRoo } } } - fmt.Println(newLeaves) - fmt.Println(expectedNewRoot) - fmt.Println(oldProofNodes) if err := m.validateMapRoot(expectedNewRoot, mapID, newLeaves, oldProofNodes); err != nil { errList = append(errList, err) } diff --git a/integration/monitor_test.go b/integration/monitor_test.go index ed0f48854..483a80471 100644 --- a/integration/monitor_test.go +++ b/integration/monitor_test.go @@ -41,16 +41,13 @@ amFdON6OhjYnBmJWe4fVnbxny0PfpkvXtg== -----END EC PRIVATE KEY-----` ) -func TestMonitorEmptyStart(t *testing.T) { +func TestMonitor(t *testing.T) { bctx := context.Background() env := NewEnv(t) defer env.Close(t) env.Client.RetryCount = 0 // setup monitor: - - // TODO(ismail) setup a proper log environment in the integration - // environment, then use GetDomainInfo here: c := spb.NewKeyTransparencyServiceClient(env.Conn) resp, err := c.GetDomainInfo(bctx, &kpb.GetDomainInfoRequest{}) if err != nil { @@ -63,6 +60,7 @@ func TestMonitorEmptyStart(t *testing.T) { //logTree := resp.Log mapTree := resp.Map store := storage.New() + // TODO(ismail): setup and use a real logVerifier instead: mon, err := monitor.New(fake.NewFakeTrillianLogVerifier(), mapTree, crypto.NewSHA256Signer(signer), store) if err != nil { t.Fatalf("Couldn't create monitor: %v", err)