diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 3af0d603..1bb8146b 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -11,7 +11,6 @@ import ( "github.com/sirupsen/logrus" teetypes "github.com/masa-finance/tee-types/types" - "github.com/masa-finance/tee-worker/api/types" . "github.com/masa-finance/tee-worker/internal/api" "github.com/masa-finance/tee-worker/internal/config" "github.com/masa-finance/tee-worker/pkg/client" @@ -45,7 +44,7 @@ var _ = Describe("API", func() { return err } - signature, err := c.CreateJobSignature(types.Job{ + signature, err := c.CreateJobSignature(teetypes.Job{ Type: teetypes.WebJob, Arguments: map[string]interface{}{}, }) @@ -73,7 +72,7 @@ var _ = Describe("API", func() { It("should submit a job and get the correct result", func() { // Step 1: Create the job request // we use TikTok transcription here as it's supported by all workers without any unique config - job := types.Job{ + job := teetypes.Job{ Type: teetypes.TiktokJob, Arguments: map[string]interface{}{ "type": "transcription", @@ -108,7 +107,7 @@ var _ = Describe("API", func() { It("bubble up errors", func() { // Step 1: Create the job request - job := types.Job{ + job := teetypes.Job{ Type: "not-existing scraper", Arguments: map[string]interface{}{ "url": "google", diff --git a/pkg/client/http.go b/pkg/client/http.go index 4ee19380..7d05b9e2 100644 --- a/pkg/client/http.go +++ b/pkg/client/http.go @@ -8,6 +8,7 @@ import ( "net/http" "time" + teetypes "github.com/masa-finance/tee-types/types" "github.com/masa-finance/tee-worker/api/types" ) @@ -43,7 +44,7 @@ func NewClient(baseURL string, opts ...Option) (*Client, error) { // CreateJobSignature sends a job to the server to generate a job signature. // The server will attach its worker ID to the job before generating the signature. -func (c *Client) CreateJobSignature(job types.Job) (JobSignature, error) { +func (c *Client) CreateJobSignature(job teetypes.Job) (JobSignature, error) { jobJSON, err := json.Marshal(job) if err != nil { return JobSignature(""), fmt.Errorf("error marshaling job: %w", err) diff --git a/pkg/client/http_test.go b/pkg/client/http_test.go index e49bc3ac..9eaeee5f 100644 --- a/pkg/client/http_test.go +++ b/pkg/client/http_test.go @@ -5,6 +5,7 @@ import ( "net/http" "net/http/httptest" + teetypes "github.com/masa-finance/tee-types/types" "github.com/masa-finance/tee-worker/api/types" . "github.com/masa-finance/tee-worker/pkg/client" . "github.com/onsi/ginkgo/v2" @@ -58,7 +59,7 @@ var _ = Describe("Client", func() { Describe("CreateJobSignature", func() { It("should create a job signature successfully", func() { - job := types.Job{Type: "test-job"} + job := teetypes.Job{Type: "test-job"} signature, err := client.CreateJobSignature(job) Expect(err).NotTo(HaveOccurred()) Expect(signature).To(Equal(JobSignature("mock-signature")))