Skip to content

Commit

Permalink
Feature: API endpoint for getting opg storage diff (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored Dec 15, 2021
1 parent a5c835c commit 02fba81
Show file tree
Hide file tree
Showing 6 changed files with 423 additions and 1 deletion.
133 changes: 133 additions & 0 deletions cmd/api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,63 @@ var doc = `{
}
}
},
"/v1/global_constants/{network}/{address}": {
"get": {
"description": "Get global constant",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"contract"
],
"summary": "Get global constant",
"operationId": "get-global-constant",
"parameters": [
{
"type": "string",
"description": "network",
"name": "network",
"in": "path",
"required": true
},
{
"maxLength": 54,
"minLength": 54,
"type": "string",
"description": "expr address of constant",
"name": "address",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.GlobalConstant"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
}
}
}
},
"/v1/head": {
"get": {
"description": "Get indexer head for each network",
Expand Down Expand Up @@ -2508,6 +2565,59 @@ var doc = `{
}
}
},
"/v1/operation/{hash}/{index}/storage_diff": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"operations"
],
"summary": "Get code line where operation failed",
"operationId": "get-operation-storage-diff",
"parameters": [
{
"maxLength": 51,
"minLength": 51,
"type": "string",
"description": "Operation group hash",
"name": "hash",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Content index",
"name": "index",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.GetErrorLocationResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
}
}
}
},
"/v1/operation/{id}/error_location": {
"get": {
"consumes": [
Expand Down Expand Up @@ -4084,6 +4194,29 @@ var doc = `{
}
}
},
"handlers.GlobalConstant": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"level": {
"type": "integer"
},
"network": {
"type": "integer"
},
"timestamp": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"handlers.HeadResponse": {
"type": "object",
"properties": {
Expand Down
133 changes: 133 additions & 0 deletions cmd/api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,63 @@
}
}
},
"/v1/global_constants/{network}/{address}": {
"get": {
"description": "Get global constant",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"contract"
],
"summary": "Get global constant",
"operationId": "get-global-constant",
"parameters": [
{
"type": "string",
"description": "network",
"name": "network",
"in": "path",
"required": true
},
{
"maxLength": 54,
"minLength": 54,
"type": "string",
"description": "expr address of constant",
"name": "address",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.GlobalConstant"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
}
}
}
},
"/v1/head": {
"get": {
"description": "Get indexer head for each network",
Expand Down Expand Up @@ -2490,6 +2547,59 @@
}
}
},
"/v1/operation/{hash}/{index}/storage_diff": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"operations"
],
"summary": "Get code line where operation failed",
"operationId": "get-operation-storage-diff",
"parameters": [
{
"maxLength": 51,
"minLength": 51,
"type": "string",
"description": "Operation group hash",
"name": "hash",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Content index",
"name": "index",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.GetErrorLocationResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.Error"
}
}
}
}
},
"/v1/operation/{id}/error_location": {
"get": {
"consumes": [
Expand Down Expand Up @@ -4066,6 +4176,29 @@
}
}
},
"handlers.GlobalConstant": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"level": {
"type": "integer"
},
"network": {
"type": "integer"
},
"timestamp": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"handlers.HeadResponse": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 02fba81

Please sign in to comment.