Skip to content
Open
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
2 changes: 1 addition & 1 deletion client/swagger/models/deal_list_deal_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions client/swagger/models/model_deal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion client/swagger/models/model_deal_type.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/swagger/models/schedule_create_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/swagger/models/schedule_update_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/deal/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var ListCmd = &cli.Command{
},
&cli.StringSliceFlag{
Name: "deal-type",
Usage: "Filter deals by type: market (legacy f05), pdp (f41 PDP deals)",
Usage: "Filter deals by type: market, f05_paid, pdp, ddo",
},
},
Action: func(c *cli.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/deal/schedule/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var CreateCmd = &cli.Command{
&cli.StringFlag{
Name: "deal-type",
Category: "Deal Proposal",
Usage: "Deal type: market (legacy f05), pdp (f41), or ddo (DDO allocations)",
Usage: "Deal type: market (legacy f05), f05_paid (f05 with on-chain payments), pdp (f41), or ddo (DDO allocations)",
Value: string(model.DealTypeMarket),
},
&cli.StringSliceFlag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/deal/schedule/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var UpdateCmd = &cli.Command{
&cli.StringFlag{
Name: "deal-type",
Category: "Deal Proposal",
Usage: "Deal type: market (legacy f05) or pdp (f41)",
Usage: "Deal type: market (legacy f05), f05_paid (f05 with on-chain payments), pdp (f41), or ddo (DDO allocations)",
},
&cli.BoolFlag{
Name: "ipni",
Expand Down
2 changes: 1 addition & 1 deletion docs/en/cli-reference/deal/list.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/en/cli-reference/deal/schedule/create.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/en/cli-reference/deal/schedule/update.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions docs/swagger/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions docs/swagger/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions docs/swagger/swagger.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion handler/deal/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ListDealRequest struct {
Schedules []uint32 `json:"schedules"` // schedule id filter
Providers []string `json:"providers"` // provider filter
States []model.DealState `json:"states"` // state filter
DealTypes []model.DealType `json:"dealTypes"` // deal type filter (market for f05, pdp for f41)
DealTypes []model.DealType `json:"dealTypes"` // deal type filter (market/f05_paid for f05, pdp for f41, ddo for allocations)
}

// ListHandler retrieves a list of deals from the database based on the specified filtering criteria in ListDealRequest.
Expand Down
2 changes: 1 addition & 1 deletion handler/deal/schedule/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
type CreateRequest struct {
Preparation string `json:"preparation" validation:"required"` // Preparation ID or name
Provider string `json:"provider" validation:"required"` // Provider
DealType string `json:"dealType"` // Deal type: market (f05), pdp (f41), or ddo
DealType string `json:"dealType"` // Deal type: market (legacy f05), f05_paid (f05 with on-chain payments), pdp (f41), or ddo
HTTPHeaders []string `json:"httpHeaders"` // http headers to be passed with the request (i.e. key=value)
URLTemplate string `json:"urlTemplate"` // URL template with PIECE_CID placeholder for boost to fetch the CAR file, i.e. http://127.0.0.1/piece/{PIECE_CID}.car
PricePerGBEpoch float64 `default:"0" json:"pricePerGbEpoch"` // Price in FIL per GiB per epoch
Expand Down
13 changes: 13 additions & 0 deletions handler/deal/schedule/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@ func TestCreateHandler_PDPRejectsPreparationWithOversizedPiece(t *testing.T) {
})
}

func TestCreateHandler_F05PaidAccepted(t *testing.T) {
testutil.All(t, func(ctx context.Context, t *testing.T, db *gorm.DB) {
prep := createPrepWithWallet(t, db, "")
req := createRequest
req.Preparation = fmt.Sprintf("%d", prep.ID)
req.DealType = string(model.DealTypeF05Paid)

schedule, err := Default.CreateHandler(ctx, db, getMockLotusClient(), req)
require.NoError(t, err)
require.Equal(t, model.DealTypeF05Paid, schedule.DealType)
})
}

func TestCreateHandler_ProviderNormalizedToActorID(t *testing.T) {
testutil.All(t, func(ctx context.Context, t *testing.T, db *gorm.DB) {
createPrepWithWallet(t, db, "")
Expand Down
2 changes: 1 addition & 1 deletion handler/deal/schedule/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type UpdateRequest struct {
//nolint:tagliatelle
AllowedPieceCIDs []string `json:"allowedPieceCids"` // Allowed piece CIDs in this schedule
Force *bool `json:"force"` // Force to send out deals regardless of replication restriction
DealType *string `json:"dealType"` // Deal type: market (f05) or pdp (f41)
DealType *string `json:"dealType"` // Deal type: market (legacy f05), f05_paid (f05 with on-chain payments), pdp (f41), or ddo
}

// UpdateHandler modifies an existing schedule record based on the provided update request.
Expand Down
13 changes: 13 additions & 0 deletions handler/deal/schedule/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,19 @@ func TestUpdateHandler_DDORequiresURLTemplate(t *testing.T) {
})
}

func TestUpdateHandler_F05PaidAccepted(t *testing.T) {
testutil.All(t, func(ctx context.Context, t *testing.T, db *gorm.DB) {
err := db.Create(&model.Schedule{
Preparation: &model.Preparation{},
}).Error
require.NoError(t, err)
req := UpdateRequest{DealType: ptr.Of(string(model.DealTypeF05Paid))}
schedule, err := Default.UpdateHandler(ctx, db, 1, req)
require.NoError(t, err)
require.Equal(t, model.DealTypeF05Paid, schedule.DealType)
})
}

func TestUpdateHandler_DDOClearURLTemplateRejected(t *testing.T) {
testutil.All(t, func(ctx context.Context, t *testing.T, db *gorm.DB) {
err := db.Create(&model.Schedule{
Expand Down
Loading
Loading