-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: increase rpc error information propagation
- Loading branch information
Showing
7 changed files
with
76 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const starknet_api_openrpc = require('starknet_specs/api/starknet_api_openrpc.json'); | ||
const starknet_trace_api_openrpc = require('starknet_specs/api/starknet_trace_api_openrpc.json'); | ||
const starknet_write_api = require('starknet_specs/api/starknet_write_api.json'); | ||
|
||
const errors = Object.fromEntries( | ||
Object.entries({ | ||
...starknet_trace_api_openrpc.components.errors, | ||
...starknet_write_api.components.errors, | ||
...starknet_api_openrpc.components.errors, | ||
}) | ||
.map((e) => [e[0], e[1].code]) | ||
.sort((a, b) => a[1] - b[1]) | ||
); | ||
|
||
console.log(errors); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const errors = { | ||
FAILED_TO_RECEIVE_TXN: 1, | ||
CONTRACT_NOT_FOUND: 20, | ||
BLOCK_NOT_FOUND: 24, | ||
INVALID_TXN_INDEX: 27, | ||
CLASS_HASH_NOT_FOUND: 28, | ||
TXN_HASH_NOT_FOUND: 29, | ||
PAGE_SIZE_TOO_BIG: 31, | ||
NO_BLOCKS: 32, | ||
INVALID_CONTINUATION_TOKEN: 33, | ||
TOO_MANY_KEYS_IN_FILTER: 34, | ||
CONTRACT_ERROR: 40, | ||
TRANSACTION_EXECUTION_ERROR: 41, | ||
CLASS_ALREADY_DECLARED: 51, | ||
INVALID_TRANSACTION_NONCE: 52, | ||
INSUFFICIENT_MAX_FEE: 53, | ||
INSUFFICIENT_ACCOUNT_BALANCE: 54, | ||
VALIDATION_FAILURE: 55, | ||
COMPILATION_FAILED: 56, | ||
CONTRACT_CLASS_SIZE_IS_TOO_LARGE: 57, | ||
NON_ACCOUNT: 58, | ||
DUPLICATE_TX: 59, | ||
COMPILED_CLASS_HASH_MISMATCH: 60, | ||
UNSUPPORTED_TX_VERSION: 61, | ||
UNSUPPORTED_CONTRACT_CLASS_VERSION: 62, | ||
UNEXPECTED_ERROR: 63, | ||
}; | ||
export default errors; |