From 803579044fae08382dd1c765156e2641184fd7ef Mon Sep 17 00:00:00 2001 From: grantdfoster Date: Wed, 24 Sep 2025 01:41:52 +0200 Subject: [PATCH 1/2] feat: bump types --- internal/api/api_test.go | 7 +++---- pkg/client/http.go | 3 ++- pkg/client/http_test.go | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) 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"))) From 186e922f3af181339774e02640be203dc13aac0c Mon Sep 17 00:00:00 2001 From: grantdfoster Date: Wed, 24 Sep 2025 01:42:37 +0200 Subject: [PATCH 2/2] chore: update types --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8aef56f6..bc4729b4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/joho/godotenv v1.5.1 github.com/labstack/echo-contrib v0.17.4 github.com/labstack/echo/v4 v4.13.4 - github.com/masa-finance/tee-types v1.1.15 + github.com/masa-finance/tee-types v1.1.16 github.com/onsi/ginkgo/v2 v2.23.4 github.com/onsi/gomega v1.38.0 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index bdb89acb..c913b4fe 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ github.com/labstack/echo/v4 v4.13.4 h1:oTZZW+T3s9gAu5L8vmzihV7/lkXGZuITzTQkTEhcX github.com/labstack/echo/v4 v4.13.4/go.mod h1:g63b33BZ5vZzcIUF8AtRH40DrTlXnx4UMC8rBdndmjQ= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= -github.com/masa-finance/tee-types v1.1.15 h1:DfTNAYsG5g3XPxzJ2kw1bbT536mOeux3ZxaAq8XnNLg= -github.com/masa-finance/tee-types v1.1.15/go.mod h1:sB98t0axFlPi2d0zUPFZSQ84mPGwbr9eRY5yLLE3fSc= +github.com/masa-finance/tee-types v1.1.16 h1:tZCV908nFq3gh9E3kG/D436Y8Z2nQdRjo0YYwV4s43o= +github.com/masa-finance/tee-types v1.1.16/go.mod h1:sB98t0axFlPi2d0zUPFZSQ84mPGwbr9eRY5yLLE3fSc= github.com/masa-finance/twitter-scraper v1.0.2 h1:him+wvYZHg/7EDdy73z1ceUywDJDRAhPLD2CSEa2Vfk= github.com/masa-finance/twitter-scraper v1.0.2/go.mod h1:38MY3g/h4V7Xl4HbW9lnkL8S3YiFZenBFv86hN57RG8= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=