You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: audithistory.go
    path of file: ./repos/storj/satellite/satellitedb
    
    the code of the file until where you have to start completion: // Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.

package satellitedb

import (
	"context"

	"storj.io/common/pb"
	"storj.io/storj/satellite/reputation"
)

func mergeAuditHistory(ctx context.Context, oldHistory []byte, addHistory []*pb.AuditWindow, config reputation.AuditHistoryConfig) (res *reputation.UpdateAuditHistoryResponse, err error) {
	defer mon.Task()(&ctx)(&err)

	history := &pb.Audit
    
func mergeAuditHistory(ctx context.Context, oldHistory []byte, addHistory []*pb.AuditWindow, config reputation.AuditHistoryConfig) (res *reputation.UpdateAuditHistoryResponse, err error) {
	defer mon.Task()(&ctx)(&err)

	history := &pb.AuditHistory{}
	err = pb.Unmarshal(oldHistory, history)
	if err != nil {
		return nil, Error.Wrap(err)
	}

	trackingPeriodFull := reputation.MergeAuditHistories(history, addHistory, config)

	historyBytes, err := pb.Marshal(history)
	if err != nil {
		return nil, Error.Wrap(err)
	}

	return &reputation.UpdateAuditHistoryResponse{
		NewScore:           history.Score,
		TrackingPeriodFull: trackingPeriodFull,
		History:            historyBytes,
	}, nil
}