func (s *Service) GetTask(taskKey string) (*Service_Task, error) {
	for _, task := range s.Tasks {
		if task.Key == taskKey {
			return task, nil
		}
	}
	return nil, fmt.Errorf("service %q - task %q not found", s.Name, taskKey)
}
GetTask returns task taskKey of service.
package service
import (
	"fmt"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/mesg-foundation/engine/hash"
	"github.com/mesg-foundation/engine/protobuf/types"
	"github.com/tendermint/tendermint/crypto"
)
func New(sid, name, description string, configuration Service_Configuration, tasks []*Service_Task, events []*Service_Event, dependencies []*Service_Dependency, repository, source string) (*Service, error) {
	srv := &Service{
		Sid:           sid,
		Name:          name,
		Description:   description,
		Configuration: configuration,
		Tasks:         tasks,
		Events:        events,
		Dependencies:  dependencies,
		Repository:    repository,
		Source:        source,
	}
	srv.Hash = hash.Dump(srv)
	srv.Address = sdk.AccAddress(crypto.AddressHash(srv.Hash))
	if srv.Sid == "" {
		srv.Sid = "_" + srv.Hash.String()
	}
	return srv, srv.Validate()
}
const MainServiceKey = "service"
func (s *Service) GetDependency(dependencyKey string) (*Service_Dependency, error) {
	for _, dep := range s.Dependencies {
		if dep.Key == dependencyKey {
			return dep, nil
		}
	}
	return nil, fmt.Errorf("service %q - dependency %s does not exist", s.Name, dependencyKey)
}