paritytech / json-rpc-interface-spec

30 stars 3 forks source link

chainHead/unpin: Return error on duplicate hashes #135

Closed lexnv closed 9 months ago

lexnv commented 9 months ago

This PR clarifies the behavior of the server when the chainHead_unpin receives duplicate hashes.

When duplicate hashes are received as parameters, the server returns -32804. Likewise, the server could return the -32602 for invalid parameters. However, I thought a dedicated error would provide clear details to the user wrt what needs to be changed. This felt appropriate since we also have a dedicated error for withRuntime flag:

-32802 is generated if the followSubscription corresponds to a follow where withRuntime was false.

cc @paritytech/subxt-team cc: https://github.com/paritytech/polkadot-sdk/pull/3313#discussion_r1488492795

Closes: https://github.com/paritytech/json-rpc-interface-spec/issues/133