Skip to content

Commit

Permalink
Merge pull request #135 from paritytech/lexnv/unpin-duplicate-hashes
Browse files Browse the repository at this point in the history
chainHead/unpin: Return error on duplicate hashes
  • Loading branch information
lexnv authored Feb 14, 2024
2 parents 8803164 + 167c32c commit 5df129d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/chainHead_unstable_unpin.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Parameters**:

- `followSubscription`: An opaque string that was returned by `chainHead_unstable_follow`.
- `hashOrHashes`: String or array of strings containing the hexadecimal-encoded hash of the header of the block to unpin.
- `hashOrHashes`: String or array of unique strings containing the hexadecimal-encoded hash of the header of the block to unpin.

**Return value**: *null*

Expand All @@ -18,5 +18,6 @@ If this function returns an error, then no block has been unpinned. An JSON-RPC
## Possible errors

- A JSON-RPC error with error code `-32801` is generated if the `followSubscription` is valid but at least one of the block hashes passed as parameter doesn't correspond to any block that has been reported by `chainHead_unstable_follow`, or at least one of the block hashes has been unpinned.
- A JSON-RPC error with error code `-32804` is generated if the `hashOrHashes` parameter is an array and at least one of the block hashes is duplicated.
- A JSON-RPC error with error code `-32602` is generated if one of the parameters doesn't correspond to the expected type (similarly to a missing parameter or an invalid parameter type).
- No error is generated if the `followSubscription` is invalid or stale. The call is simply ignored.

0 comments on commit 5df129d

Please sign in to comment.