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: chain_test.go
    path of file: ./repos/chainlink/core/chains/legacyevm
    
    the code of the file until where you have to start completion: package legacyevm_test

import (
	"math/big"
	"testing"

	"github.com/stretchr/testify/assert"

	"github.com/jmoiron/sqlx"

	"github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox"

	"github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm"
	"github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm/mocks"
	"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"
	"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest"
)

func TestLegacyChains(t *testing.T) {
	legacy
    
func TestChainOpts_Validate(t *testing.T) {
	type fields struct {
		AppConfig legacyevm.AppConfig
		MailMon   *mailbox.Monitor
		DB        *sqlx.DB
	}
	tests := []struct {
		name    string
		fields  fields
		wantErr bool
	}{
		{
			name: "valid",
			fields: fields{
				AppConfig: configtest.NewTestGeneralConfig(t),
				MailMon:   &mailbox.Monitor{},
				DB:        pgtest.NewSqlxDB(t),
			},
		},
		{
			name: "invalid",
			fields: fields{
				AppConfig: nil,
				MailMon:   nil,
				DB:        nil,
			},
			wantErr: true,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			o := legacyevm.ChainOpts{
				AppConfig: tt.fields.AppConfig,
				MailMon:   tt.fields.MailMon,
				DB:        tt.fields.DB,
			}
			if err := o.Validate(); (err != nil) != tt.wantErr {
				t.Errorf("ChainOpts.Validate() error = %v, wantErr %v", err, tt.wantErr)
			}
		})
	}
}