From c2e8092fa0dfd5c0df13cca0338b640a867e4cbf Mon Sep 17 00:00:00 2001 From: Omri Eshhar Date: Thu, 14 Sep 2023 11:20:37 +0300 Subject: [PATCH] feat: error code for un-synced node --- api/starknet_api_openrpc.json | 51 ++++++++++++++++++++++++++++- api/starknet_trace_api_openrpc.json | 12 ++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index e5b35b2..02769b0 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -55,6 +55,9 @@ "errors": [ { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -92,6 +95,9 @@ "errors": [ { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -129,6 +135,9 @@ "errors": [ { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -181,6 +190,9 @@ }, { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -323,6 +335,9 @@ }, { "$ref": "#/components/errors/INVALID_TXN_INDEX" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -408,6 +423,9 @@ }, { "$ref": "#/components/errors/CLASS_HASH_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -448,6 +466,9 @@ }, { "$ref": "#/components/errors/CONTRACT_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -497,6 +518,9 @@ }, { "$ref": "#/components/errors/CONTRACT_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -528,6 +552,9 @@ "errors": [ { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -576,6 +603,9 @@ }, { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -628,6 +658,9 @@ }, { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -688,6 +721,9 @@ "errors": [ { "$ref": "#/components/errors/NO_BLOCKS" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -720,6 +756,9 @@ "errors": [ { "$ref": "#/components/errors/NO_BLOCKS" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -804,6 +843,9 @@ }, { "$ref": "#/components/errors/TOO_MANY_KEYS_IN_FILTER" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -844,6 +886,9 @@ }, { "$ref": "#/components/errors/CONTRACT_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] } @@ -3874,6 +3919,10 @@ "code": 34, "message": "Too many keys provided in a filter" }, + "NODE_NOT_SYNCED": { + "code": 35, + "message": "Node is not synchronized" + }, "CONTRACT_ERROR": { "code": 40, "message": "Contract error", @@ -3892,4 +3941,4 @@ } } } -} \ No newline at end of file +} diff --git a/api/starknet_trace_api_openrpc.json b/api/starknet_trace_api_openrpc.json index cb51889..b962217 100644 --- a/api/starknet_trace_api_openrpc.json +++ b/api/starknet_trace_api_openrpc.json @@ -104,6 +104,9 @@ }, { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] }, @@ -143,6 +146,9 @@ "errors": [ { "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/NODE_NOT_SYNCED" } ] } @@ -500,10 +506,14 @@ "code": 24, "message": "Block not found" }, + "NODE_NOT_SYNCED": { + "code": 35, + "message": "Node is not synchronized" + }, "CONTRACT_ERROR": { "code": 40, "message": "Contract error" } } } -} \ No newline at end of file +}