func (c *MutatingLogClient) GetConsistencyProof(ctx context.Context, in *trillian.GetConsistencyProofRequest, opts ...grpc.CallOption) (*trillian.GetConsistencyProofResponse, error) {
	resp, err := c.TrillianLogClient.GetConsistencyProof(ctx, in)
	if err != nil {
		return nil, err
	}
	if c.mutateConsistencyProof {
		if len(resp.Proof.Hashes) == 0 {
			glog.Warningf("Consistency proof not modified because len(Hashes) = 0")
			return resp, nil
		}
		i := rand.Intn(len(resp.Proof.Hashes))
		j := rand.Intn(len(resp.Proof.Hashes[i]))
		resp.Proof.Hashes[i][j] ^= 4
	}
	return resp, nil
}
GetConsistencyProof forwards requests and optionally corrupts responses.
package client
import (
	"context"
	"math/rand"
	"github.com/golang/glog"
	"github.com/google/trillian"
	"github.com/google/trillian/types"
	"google.golang.org/grpc"
)
type MutatingLogClient struct {
	trillian.TrillianLogClient
	mutateInclusionProof   bool
	mutateConsistencyProof bool
	mutateRootSize         bool
}
func (c *MutatingLogClient) GetLatestSignedLogRoot(ctx context.Context, in *trillian.GetLatestSignedLogRootRequest, opts ...grpc.CallOption) (*trillian.GetLatestSignedLogRootResponse, error) {
	resp, err := c.TrillianLogClient.GetLatestSignedLogRoot(ctx, in)
	if c.mutateRootSize {
		var root types.LogRootV1
		if err := root.UnmarshalBinary(resp.SignedLogRoot.LogRoot); err != nil {
			panic("failed to unmarshal")
		}
		root.TreeSize += 10000
		resp.SignedLogRoot.LogRoot, _ = root.MarshalBinary()
	}
	return resp, err
}
func (c *MutatingLogClient) GetInclusionProof(ctx context.Context, in *trillian.GetInclusionProofRequest, opts ...grpc.CallOption) (*trillian.GetInclusionProofResponse, error) {
	resp, err := c.TrillianLogClient.GetInclusionProof(ctx, in)
	if c.mutateInclusionProof {
		i := rand.Intn(len(resp.Proof.Hashes))
		j := rand.Intn(len(resp.Proof.Hashes[i]))
		resp.Proof.Hashes[i][j] ^= 4
	}
	return resp, err
}
func (c *MutatingLogClient) GetInclusionProofByHash(ctx context.Context, in *trillian.GetInclusionProofByHashRequest, opts ...grpc.CallOption) (*trillian.GetInclusionProofByHashResponse, error) {
	resp, err := c.TrillianLogClient.GetInclusionProofByHash(ctx, in)
	if err != nil {
		return nil, err
	}
	if c.mutateInclusionProof {
		h := rand.Intn(len(resp.Proof))
		if len(resp.Proof[h].Hashes) == 0 {
			glog.Warningf("Inclusion proof not modified because treesize = 0")
			return resp, nil
		}
		i := rand.Intn(len(resp.Proof[h].Hashes))
		j := rand.Intn(len(resp.Proof[h].Hashes[i]))
		resp.Proof[h].Hashes[i][j] ^= 4
	}
	return resp, nil
}