Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
144bd228
Commit
144bd228
authored
5 years ago
by
Bastian Köcher
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve `insert_key` error message on unsupported key type (#3490)
parent
0128d0db
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/core/rpc/src/author/error.rs
+10
-0
10 additions, 0 deletions
substrate/core/rpc/src/author/error.rs
with
10 additions
and
0 deletions
substrate/core/rpc/src/author/error.rs
+
10
−
0
View file @
144bd228
...
...
@@ -83,6 +83,8 @@ const POOL_TOO_LOW_PRIORITY: i64 = POOL_INVALID_TX + 4;
const
POOL_CYCLE_DETECTED
:
i64
=
POOL_INVALID_TX
+
5
;
/// The transaction was not included to the pool because of the limits.
const
POOL_IMMEDIATELY_DROPPED
:
i64
=
POOL_INVALID_TX
+
6
;
/// The key type crypto is not known.
const
UNSUPPORTED_KEY_TYPE
:
i64
=
POOL_INVALID_TX
+
7
;
impl
From
<
Error
>
for
rpc
::
Error
{
fn
from
(
e
:
Error
)
->
Self
{
...
...
@@ -134,6 +136,14 @@ impl From<Error> for rpc::Error {
message
:
"Immediately Dropped"
.into
(),
data
:
Some
(
"The transaction couldn't enter the pool because of the limit"
.into
()),
},
Error
::
UnsupportedKeyType
=>
rpc
::
Error
{
code
:
rpc
::
ErrorCode
::
ServerError
(
UNSUPPORTED_KEY_TYPE
),
message
:
"Unknown key type crypto"
.into
(),
data
:
Some
(
"The crypto for the given key type is unknown, please add the public key to the
\
request to insert the key successfully."
.into
()
),
},
e
=>
errors
::
internal
(
e
),
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment