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: verify.go
    path of file: ./repos/chainlink/core/scripts/chaincli/handler
    
    the code of the file until where you have to start completion: package handler

import (
	"fmt"
	"log"
	"os"
	"os/exec"
	"path/filepath"
)

func (k *Keeper) changeToContractsDirectory() error {
	// Get the current working directory
	currentDir, err := os.Getwd()
	if err != nil {
		return fmt.Errorf("failed to get current working directory: %w", err)
	}

	// Check if hardhat.config.ts exists in the current directory, return if it does
	if _, err := os.Stat(filepath.Join(currentDir, "hardhat.config.ts")); err == nil {
		return nil
	}

	// Command should run from core/scripts/chaincli, so we need to change directory to contracts
	// Calculate the absolute path of the target directory
	absPath := filepath.Join(currentDir, "../../../contracts")

	// Change directory
	if err := os.Chdir(absPath); err != nil {
		return fmt.Errorf("failed to change directory: %w", err)
	}

	// Check if hardhat.config.ts exists in the current directory
	if _, err := os.Stat(filepath.Join(absPath, "hardhat.config.ts")); err != nil {
    
func (k *Keeper) changeToContractsDirectory() error {
	// Get the current working directory
	currentDir, err := os.Getwd()
	if err != nil {
		return fmt.Errorf("failed to get current working directory: %w", err)
	}

	// Check if hardhat.config.ts exists in the current directory, return if it does
	if _, err := os.Stat(filepath.Join(currentDir, "hardhat.config.ts")); err == nil {
		return nil
	}

	// Command should run from core/scripts/chaincli, so we need to change directory to contracts
	// Calculate the absolute path of the target directory
	absPath := filepath.Join(currentDir, "../../../contracts")

	// Change directory
	if err := os.Chdir(absPath); err != nil {
		return fmt.Errorf("failed to change directory: %w", err)
	}

	// Check if hardhat.config.ts exists in the current directory
	if _, err := os.Stat(filepath.Join(absPath, "hardhat.config.ts")); err != nil {
		return fmt.Errorf("hardhat.config.ts not found in the current directory")
	}

	log.Printf("Successfully changed to directory %s\n", absPath)

	return nil
}