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

Commit

Permalink
remove debug output, some minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
liamsi committed Aug 25, 2017
1 parent d550d59 commit 913b298
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
8 changes: 0 additions & 8 deletions core/monitor/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

"github.com/google/keytransparency/core/mutator/entry"
ktpb "github.com/google/keytransparency/core/proto/keytransparency_v1_types"
"fmt"
)

var (
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down
6 changes: 2 additions & 4 deletions integration/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 913b298

Please sign in to comment.