func (k Keeper) IsTestingResultsPresents(ctx sdk.Context, vid uint16, pid uint16) bool {
	store := ctx.KVStore(k.storeKey)
	return store.Has(types.GetTestingResultsKey(vid, pid))
}
Check if the TestingResults record is present in the store or not.
package keeper
import (
	"github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/zigbee-alliance/distributed-compliance-ledger/x/compliancetest/internal/types"
)
type Keeper struct {
	storeKey sdk.StoreKey
	cdc *codec.Codec
}
func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec) Keeper {
	return Keeper{storeKey: storeKey, cdc: cdc}
}
func (k Keeper) GetTestingResults(ctx sdk.Context, vid uint16, pid uint16) types.TestingResults {
	if !k.IsTestingResultsPresents(ctx, vid, pid) {
		return types.NewTestingResults(vid, pid)
	}
	store := ctx.KVStore(k.storeKey)
	bz := store.Get(types.GetTestingResultsKey(vid, pid))
	var testingResults types.TestingResults
	k.cdc.MustUnmarshalBinaryBare(bz, &testingResults)
	return testingResults
}
func (k Keeper) SetTestingResults(ctx sdk.Context, testingResult types.TestingResults) {
	store := ctx.KVStore(k.storeKey)
	store.Set(types.GetTestingResultsKey(
		testingResult.VID, testingResult.PID), k.cdc.MustMarshalBinaryBare(testingResult))
}
func (k Keeper) AddTestingResult(ctx sdk.Context, testingResult types.TestingResult) {
	testingResults := k.GetTestingResults(ctx, testingResult.VID, testingResult.PID)
	testingResults.AddTestingResult(testingResult)
	store := ctx.KVStore(k.storeKey)
	store.Set(types.GetTestingResultsKey(testingResult.VID, testingResult.PID),
		k.cdc.MustMarshalBinaryBare(testingResults))
}