MetaMask / MetaMask/metamask-extension
[Bug]: when rejecting the `eth_getEncryptionPublicKey` JSON-RPC method it does not return 4001
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### Describe the bug
I wrote a rule for the API Spec Test that expects all the confirmations to reject with 4001 and this method fails.
### Expected behavior
When rejecting I should see the response:
```json
{
"id": 10,
"jsonrpc": "2.0",
"error": {
"code": 4001,
"message": "User rejected the request."
}
}
```
### Screenshots/Recordings

### Steps to reproduce
1. send a request to `eth_getEncryptionPublicKey`
2. hit reject
3. see the error below
### Error messages or log output
```json
{
"id": 10,
"jsonrpc": "2.0",
"error": {
"code": -32603,
"data": {
"originalError": {}
},
"message": "MetaMask EncryptionPublicKey: User denied message EncryptionPublicKey."
}
}
```
### Version
sj/api-spec-tests
### Build type
Other (please specify exactly where you obtained this build in "Additional Context" section)
### Browser
Chrome
### Operating system
MacOS
### Additional context
test build
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the API Spec Test rule for eth_getEncryptionPublicKey and trace the rejection handling for this JSON-RPC method. Compare its response with the expected 4001 error and the observed -32603 error. Done means a rejected request returns code 4001 with the specified message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100