ChainSafe / ChainSafe/gossamer
[RPC] `insertKey` method is not expecting a Substrate URI
- Dominant language
- Go
- Stars
- 454
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
## Issue summary
- I noticed that at `insertKey` RPC method the **polkadot ui** are sending the `suri` (aka Substrate URI, aka `//Allice`, `//Bob`...) but our RPC method is expecting a hexadecimal seed (if you type `subkey inspect //Allice` you will get the hex seed for the suri `//Allice`), the error the ui got is:
```
could not byteify non 0x prefixed string: null
```
- The `api.rpc.author.insertKey` polkadot js API is expecting a `suri` as paramater as well:
```
insertKey: RpcPromiseResult
(keyType: string | Text, suri: string | Text, publicKey: string | Bytes | Uint8Array)
```
## Screenshots
1) Sending a `suri` but got error response

the log what gossamer node are receiving:

2) Trying to send a hex seed, got the same error response:

the log what gossamer node are receiving:

## Other information and links
- Substrate example `insertKey` RPC method: https://github.com/paritytech/substrate/blob/1d5abf01abafdb6c15bcd0172f5de09fd87c5fbf/client/rpc/src/author/mod.rs#L94
- Substrate example `insert_unknow` implementation: https://github.com/paritytech/substrate/blob/7dcc77b982f59eaf6cec19499d981164b04a255d/client/keystore/src/local.rs#L291
- I guess the [`insertKey` RPC spec](https://github.com/w3f/PSPs/blob/master/PSPs/drafts/psp-6.md#185-author_insertkey) is not updated with this info, there says `seed` and the example shows a seed being passed as request parameter
Contributor guide
Assessment
This issue has not been assessed yet.