Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Handling an empty batch array in a request #153

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

nir11
Copy link
Contributor

@nir11 nir11 commented Jun 8, 2023

In reference to Batch section from JSON-RPC 2.0 Specification:

JSON-RPC 2 0 Specification - 1
JSON-RPC 2 0 Specification - 2

This PR includes:

  • Solution for handling an empty batch array in a request. Upon receiving an empty batch array, the response array is now populated with a single object indicating the error.
  • Addition of 2 new test functions to ensure proper validation and behavior of empty batch arrays.

@nir11 nir11 requested a review from a team as a code owner June 8, 2023 09:35
Gudahtt
Gudahtt previously approved these changes Jun 8, 2023
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left suggestions for the two lint errors

src/JsonRpcEngine.test.ts Outdated Show resolved Hide resolved
src/JsonRpcEngine.test.ts Outdated Show resolved Hide resolved
@Gudahtt Gudahtt merged commit ed51ce3 into MetaMask:main Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants