neorpc: add deprecated error codes for C#-compatibility

While our server no longer uses these codes (-100, -400) they still can come
from C# servers and while we consider them deprecated we better at least have
some definition of them until C# implements our proposal:
https://github.com/neo-project/proposals/pull/156
Also adding description of deprecated RPC error codes in ROADMAP.md.

Signed-off-by: Tatiana Nesterenko <tatiana@nspcc.io>
This commit is contained in:
Tatiana Nesterenko 2023-08-15 21:53:29 +01:00
parent 3178c8ff78
commit 3b29720298
2 changed files with 23 additions and 0 deletions

View file

@ -139,3 +139,11 @@ hidden under `version` label and `server_id` contains network server ID hidden
under `server_id` label. under `server_id` label.
Removal of `serv_node_version` is scheduled for Sep-Oct 2023 (~0.105.0 release). Removal of `serv_node_version` is scheduled for Sep-Oct 2023 (~0.105.0 release).
## RPC error codes returned by old versions and C#-nodes
NeoGo retains certain deprecated error codes: `neorpc.ErrCompatGeneric`,
`neorpc.ErrCompatNoOpenedWallet`. They returned by nodes not compliant with the
neo-project/proposals#156 (NeoGo pre-0.102.0 and all known C# versions).
Removal of the deprecated RPC error codes is planned once all nodes adopt the new error standard.

View file

@ -138,6 +138,21 @@ const (
ErrExecutionFailedCode = -608 ErrExecutionFailedCode = -608
) )
var (
// ErrCompatGeneric is an error returned by nodes not compliant with the neo-project/proposals#156
// (NeoGo pre-0.102.0 and all known C# versions).
// It can be returned for any call and doesn't have any specific meaning.
//
// Deprecated: to be removed after all nodes adopt new error standard.
ErrCompatGeneric = NewErrorWithCode(-100, "RPC error")
// ErrCompatNoOpenedWallet is an error code returned by nodes not compliant with the neo-project/proposals#156
// (all known C# versions, NeoGo never used this code). It can be returned for wallet-related operations.
//
// Deprecated: to be removed after all nodes adopt new error standard.
ErrCompatNoOpenedWallet = NewErrorWithCode(-400, "No opened wallet")
)
var ( var (
// ErrInvalidParams represents a generic "Invalid params" error. // ErrInvalidParams represents a generic "Invalid params" error.
ErrInvalidParams = NewInvalidParamsError("Invalid params") ErrInvalidParams = NewInvalidParamsError("Invalid params")