From 48f2b270f398d07277bd84e6c1731697a9af67a5 Mon Sep 17 00:00:00 2001 From: Roger <50648015+RogerLamTd@users.noreply.github.com> Date: Thu, 25 Apr 2024 01:57:30 -0400 Subject: [PATCH] fix(docs): update `swagger` github action (#761) --- .swaggo | 1 + docs/docs.go | 32 ++++++++++++-------------------- docs/swagger.json | 32 ++++++++++++-------------------- docs/swagger.yaml | 21 ++++++++------------- index.html | 2 +- prover/server/api.go | 12 ++++++------ 6 files changed, 40 insertions(+), 60 deletions(-) diff --git a/.swaggo b/.swaggo index d5eb589e3..8cc34d878 100644 --- a/.swaggo +++ b/.swaggo @@ -1 +1,2 @@ replace common.Address string +replace encoding.TierFee uint64 \ No newline at end of file diff --git a/docs/docs.go b/docs/docs.go index ed8dacf6b..3dab57e7c 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -82,36 +82,25 @@ const docTemplate = `{ } }, "definitions": { - "big.Int": { - "type": "object" - }, - "encoding.TierFee": { - "type": "object", - "properties": { - "fee": { - "$ref": "#/definitions/big.Int" - }, - "tier": { - "type": "integer" - } - } - }, "server.CreateAssignmentRequestBody": { "type": "object", "properties": { + "blobHash": { + "type": "array", + "items": { + "type": "integer" + } + }, "expiry": { "type": "integer" }, "feeToken": { "type": "string" }, - "tierFees": { - "type": "array", - "items": { - "$ref": "#/definitions/encoding.TierFee" - } + "proposer": { + "type": "string" }, - "txListHash": { + "tierFees": { "type": "array", "items": { "type": "integer" @@ -148,6 +137,9 @@ const docTemplate = `{ "minOptimisticTierFee": { "type": "integer" }, + "minSgxAndZkVMTierFee": { + "type": "integer" + }, "minSgxTierFee": { "type": "integer" }, diff --git a/docs/swagger.json b/docs/swagger.json index a79b9443a..607f9139a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -73,36 +73,25 @@ } }, "definitions": { - "big.Int": { - "type": "object" - }, - "encoding.TierFee": { - "type": "object", - "properties": { - "fee": { - "$ref": "#/definitions/big.Int" - }, - "tier": { - "type": "integer" - } - } - }, "server.CreateAssignmentRequestBody": { "type": "object", "properties": { + "blobHash": { + "type": "array", + "items": { + "type": "integer" + } + }, "expiry": { "type": "integer" }, "feeToken": { "type": "string" }, - "tierFees": { - "type": "array", - "items": { - "$ref": "#/definitions/encoding.TierFee" - } + "proposer": { + "type": "string" }, - "txListHash": { + "tierFees": { "type": "array", "items": { "type": "integer" @@ -139,6 +128,9 @@ "minOptimisticTierFee": { "type": "integer" }, + "minSgxAndZkVMTierFee": { + "type": "integer" + }, "minSgxTierFee": { "type": "integer" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 1a220dbe5..579acff4b 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,24 +1,17 @@ definitions: - big.Int: - type: object - encoding.TierFee: - properties: - fee: - $ref: '#/definitions/big.Int' - tier: - type: integer - type: object server.CreateAssignmentRequestBody: properties: + blobHash: + items: + type: integer + type: array expiry: type: integer feeToken: type: string + proposer: + type: string tierFees: - items: - $ref: '#/definitions/encoding.TierFee' - type: array - txListHash: items: type: integer type: array @@ -42,6 +35,8 @@ definitions: type: integer minOptimisticTierFee: type: integer + minSgxAndZkVMTierFee: + type: integer minSgxTierFee: type: integer prover: diff --git a/index.html b/index.html index 0ad42390a..6a06a93af 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ window.onload = function () { // Begin Swagger UI call region const ui = SwaggerUIBundle({ - url: "docs/swagger.json", //Location of Open API spec in the repo + url: "./docs/swagger.json", //Location of Open API spec in the repo dom_id: '#swagger-ui', deepLinking: true, presets: [ diff --git a/prover/server/api.go b/prover/server/api.go index 4ef5ec728..be35869ac 100644 --- a/prover/server/api.go +++ b/prover/server/api.go @@ -34,11 +34,11 @@ const ( // CreateAssignmentRequestBody represents a request body when handling assignment creation request. type CreateAssignmentRequestBody struct { - Proposer common.Address - FeeToken common.Address - TierFees []encoding.TierFee - Expiry uint64 - BlobHash common.Hash + Proposer common.Address `json:"proposer"` + FeeToken common.Address `json:"feeToken"` + TierFees []encoding.TierFee `json:"tierFees"` + Expiry uint64 `json:"expiry"` + BlobHash common.Hash `json:"blobHash"` } // Status represents the current prover server status. @@ -82,7 +82,7 @@ type ProposeBlockResponse struct { // can submit onchain. // // @Summary Try to accept a block proof assignment -// @Param body CreateAssignmentRequestBody true "assignment request body" +// @Param body body server.CreateAssignmentRequestBody true "assignment request body" // @Accept json // @Produce json // @Success 200 {object} ProposeBlockResponse