Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions internal/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{}{},
})
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion pkg/client/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"time"

teetypes "github.com/masa-finance/tee-types/types"
"github.com/masa-finance/tee-worker/api/types"
)

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion pkg/client/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")))
Expand Down
Loading